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

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

damijanc/collection
===================

A simple PHP collection class to be used instead of ArrayObject

1.0.0(7y ago)09MITPHP

Since Oct 9Pushed 7y ago1 watchersCompare

[ Source](https://github.com/damijanc/collection)[ Packagist](https://packagist.org/packages/damijanc/collection)[ RSS](/packages/damijanc-collection/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

collection
==========

[](#collection)

A simple PHP collection class to be used instead of ArrayObject

Instead of using [ArrayObject](http://php.net/manual/de/class.arrayobject.php) you can use simple collection. It implements [ArrayAccess](http://php.net/manual/en/class.arrayaccess.php) and [IteratorAggregate](http://php.net/manual/en/class.iteratoraggregate.php)so you can use it as an array:

```
$myCollection = new Collection;
$myCollection[] = 'value1';
$myCollection[] = 'value2';
$myCollection['data'] = 'value3';
```

and you can iterate it

```
foreach ($myCollection as $key => $item) {
  //you logic here
}
```

and you can use it as a base for your cool stuff like type hinting

```
class MyCoolCollection extends Collection
{

    public function add(MyCoolInterface $myCoolThing)
    {
        $this->collectionItems[] = $myCoolThing;
        return $this;
    }

    public function offsetGet($offset): MyCoolInterface
    {
        return parent::offsetGet($offset);
    }
}
```

Installation:

```
composer require damijanc/collection

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2822d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6cdbc0c6ed1511bddf2d7528b8884b3ec05c2b017531e70471337a58c4646b30?d=identicon)[damijanc](/maintainers/damijanc)

---

Top Contributors

[![damijanc](https://avatars.githubusercontent.com/u/1586796?v=4)](https://github.com/damijanc "damijanc (5 commits)")

### Embed Badge

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

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

###  Alternatives

[beyondcode/laravel-masked-db-dump

Dump masked information from your database

11345.8k](/packages/beyondcode-laravel-masked-db-dump)[mervick/aaencoder

Encode/decode any JavaScript program to/from Japanese style emoticons

411.6k](/packages/mervick-aaencoder)[appolodev/bolt-seo

Bolt 5 - Seo extension

1216.4k](/packages/appolodev-bolt-seo)

PHPackages © 2026

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