PHPackages                             equip/structure - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. equip/structure

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

equip/structure
===============

Simple, immutable data structures

1.1.0(10y ago)40201.9k52MITPHPPHP &gt;=5.5

Since Feb 6Pushed 10y ago13 watchersCompare

[ Source](https://github.com/equip/structure)[ Packagist](https://packagist.org/packages/equip/structure)[ RSS](/packages/equip-structure/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (2)

Equip Structure
---------------

[](#equip-structure)

[![Latest Stable Version](https://camo.githubusercontent.com/848c6dc3dfc367483d8c3500f1250ed812889b4557a2b6b4b4b968ec3f41d626/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65717569702f7374727563747572652e737667)](https://packagist.org/packages/equip/structure)[![License](https://camo.githubusercontent.com/88f280fcfdab3e641b1df33c94259a8b30ccc7025d795ae15e0e1301af146367/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f65717569702f7374727563747572652e737667)](https://github.com/equip/structure/blob/master/LICENSE)[![Build Status](https://camo.githubusercontent.com/c474d0c47a891e9e0bb0fcf751e8c9edd3a6da624266c95601a5b1f6fddfd0a0/68747470733a2f2f7472617669732d63692e6f72672f65717569702f7374727563747572652e737667)](https://travis-ci.org/equip/structure)[![Code Coverage](https://camo.githubusercontent.com/84f788ddcad34ebed950d40db9b383c44e82fc0d27ddbbd82af695c75fc37e3a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65717569702f7374727563747572652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/equip/structure/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b097b96ca5e7000a9b0ec1462be7020e769d139d2df2e5f2db27661833f2f19f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f65717569702f7374727563747572652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/equip/structure/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/3f214fb111b8b0e662390820fa2d24d28c7120317f4b4af1cb44f482f097c887/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465737472756b742f6465737472756b742e737667)](https://packagist.org/packages/destrukt/destrukt)

Provides a number of common data structures in [Equip](http://equip.github.io/)that are not natively supported by PHP. Each structure is represented by an immutable object that can be counted and serialized to JSON. All of the structures can be used as [iterators](http://php.net/manual/en/class.iterator.php) and [arrays](http://php.net/manual/en/class.arrayaccess.php), but cannot be modified using array functions.

For more information, see [the documentation](http://equipframework.readthedocs.org/en/latest/structure).

This package is compliant with [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md), and [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md). If you notice compliance oversights, please send a patch via pull request.

Structures
----------

[](#structures)

**`Dictionary`** is an implementation of a [associative array](https://en.wikipedia.org/wiki/Associative_array) that stores values identified by a key. Only associative arrays can be used to initialize the structure. Any value can be defined by a string key.

**`SortedDictionary`** is an implementation of a [associative array](https://en.wikipedia.org/wiki/Associative_array)that also sorts the array. When the dictionary is modified it will be sorted. By default the [`asort`](http://php.net/asort) function is used.

**`OrderedList`** is an implementation of a [list](https://en.wikipedia.org/wiki/List_(abstract_data_type)) that stores ordered values. Only an indexed array can be used to initialize the structure. Any value can be added. When the list is modified it will be sorted. By default the [`sort`](http://php.net/sort) function will be used.

**`UnorderedList`** is an implementation of a [list](https://en.wikipedia.org/wiki/List_(abstract_data_type)) that stores unordered values. The same value may appear more than once. Only an indexed array can be used to initialize the structure. Any value can be added.

**`Set`** is an implementation of a [set](https://en.wikipedia.org/wiki/Set_(abstract_data_type)) that stores a unique values. The same value will *not* appear more than once. Only an indexed array can be used to initialize the structure. Adding an existing value to the set will have no effect. A set also also be added to before or after an existing element.

Requirements
------------

[](#requirements)

The following versions of PHP are supported.

- PHP 5.5
- PHP 5.6
- PHP 7.0
- HHVM

Install
-------

[](#install)

Via Composer

```
$ composer require equip/structure
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

38

—

LowBetter than 84% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

3

Last Release

3739d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e47a502e778d0886033c82f584d39f1d06129973a6ed687ac6b016d1eb4e92d9?d=identicon)[dolfelt](/maintainers/dolfelt)

![](https://www.gravatar.com/avatar/e195387ae46f8e34639081ffa3f077cfe7b99a1c778cd4877dfa40701f303231?d=identicon)[ameech](/maintainers/ameech)

---

Top Contributors

[![shadowhand](https://avatars.githubusercontent.com/u/38203?v=4)](https://github.com/shadowhand "shadowhand (73 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

setlistdictionaryimmutablehash-mapdata structureordered-listhash tableunordered list

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/equip-structure/health.svg)

```
[![Health](https://phpackages.com/badges/equip-structure/health.svg)](https://phpackages.com/packages/equip-structure)
```

###  Alternatives

[phpcollection/phpcollection

General-Purpose Collection Library for PHP

1.0k64.0M34](/packages/phpcollection-phpcollection)[marc-mabe/php-enum

Simple and fast implementation of enumerations with native PHP

49444.8M97](/packages/marc-mabe-php-enum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
