PHPackages                             ducatel/php-collection - 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. ducatel/php-collection

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

ducatel/php-collection
======================

Implementation of data structure in PHP

08[2 issues](https://github.com/Ducatel/PHPCollection/issues)PHP

Since Aug 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Ducatel/PHPCollection)[ Packagist](https://packagist.org/packages/ducatel/php-collection)[ RSS](/packages/ducatel-php-collection/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

PHPCollection
=============

[](#phpcollection)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5324798edf1ac76a7330a5446b0176024c69faa0f52b8e88ee79c8eff6045800/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4475636174656c2f7068702d636f6c6c656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Ducatel/php-collection)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/6f9984199430b112ccc54749429f912b408be4d0a796d8304ecc854c5ac2eb47/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4475636174656c2f504850436f6c6c656374696f6e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Ducatel/PHPCollection)[![Coverage Status](https://camo.githubusercontent.com/c6116d0bce1d15449c47736f3f4c8efbd205aab6d84c3964687d1954cdfd44cd/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f4475636174656c2f504850436f6c6c656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Ducatel/PHPCollection/code-structure)[![Quality Score](https://camo.githubusercontent.com/c6612d08e37c4a1b8958599f223ded083cbd15a67d21b7b2925687d48ac6b8fd/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4475636174656c2f504850436f6c6c656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Ducatel/PHPCollection)[![Total Downloads](https://camo.githubusercontent.com/46344ae295b3176b8842966c68f589be126f6ad1f3f30bacb0dd006567b7e90c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4475636174656c2f7068702d636f6c6c656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Ducatel/PHPCollection)[![StyleCI](https://camo.githubusercontent.com/ec6daf6f13b30d657ff285db0d1034b0400e5baed3acfa0916239895193e1878/68747470733a2f2f7374796c6563692e696f2f7265706f732f36343738333636342f736869656c64)](https://styleci.io/repos/64783664)

This library adds some "standard" collections for PHP. Collections are like array which follow constrains :

- **Typed** collections which accept only one type of variable
- **Sorted** collections which are always sorted
- **Set** collections which not allows duplicates
- **Array** collections which allows duplicates

You can found also some already specialized collection for non object variable (like string or number)

Install
-------

[](#install)

Via Composer

```
$ composer require ducatel/php-collection
```

Usage
-----

[](#usage)

```
$stringArray = new Ducatel\PHPCollection\Specialized\StringArray();
$stringArray[] = "a"; // ['a']
$stringArray[] = "b"; // ['a', 'b']
$stringArray[] = new PDO(); // FAIL

$typedArray = new Ducatel\PHPCollection\TypedArray(MyClass::class);
$typedArray[] = new MyClass(); // OK
$typedArray[] = "a"; // FAIL
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [David Ducatel](https://github.com/:author_username)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/34bcdfbf55ba2322fe11d4b924a820fe5b19e1e07f8285c992898fea13d6054e?d=identicon)[dducatel](/maintainers/dducatel)

---

Top Contributors

[![Ducatel](https://avatars.githubusercontent.com/u/1184332?v=4)](https://github.com/Ducatel "Ducatel (10 commits)")

### Embed Badge

![Health badge](/badges/ducatel-php-collection/health.svg)

```
[![Health](https://phpackages.com/badges/ducatel-php-collection/health.svg)](https://phpackages.com/packages/ducatel-php-collection)
```

###  Alternatives

[elijaa/phpmemcacheadmin

Graphic stand-alone administration for memcached

2628.9k](/packages/elijaa-phpmemcacheadmin)[invaders-xx/filament-kanban-board

Add a Kanban page to filament

7617.2k](/packages/invaders-xx-filament-kanban-board)

PHPackages © 2026

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