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

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

solution10/collection
=====================

A simple and fast Collection class

v1.3.1(11y ago)4510↑400%1MITPHPPHP &gt;= 5.3.0

Since Jul 17Pushed 11y ago2 watchersCompare

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

READMEChangelogDependencies (3)Versions (7)Used By (1)

Solution10\\Collection
======================

[](#solution10collection)

Like Arrays. Only better!

[![Build Status](https://camo.githubusercontent.com/2eb69db666ea46798555ee0aa213ba9848aba65dc7e7c4638225469cdae34484/68747470733a2f2f7472617669732d63692e6f72672f536f6c7574696f6e31302f636f6c6c656374696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Solution10/collection)[![Coverage Status](https://camo.githubusercontent.com/1deb8b7cbad88e49fa62b56c2c785d1943be11d5f3e0fb9c4f12d4f6791a78dc/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f536f6c7574696f6e31302f636f6c6c656374696f6e2f62616467652e706e67)](https://coveralls.io/r/Solution10/collection)

[![Latest Stable Version](https://camo.githubusercontent.com/a606e5959a29043d82342b68e2075eae70219fab0d115705ef2af1519d46fbc1/68747470733a2f2f706f7365722e707567782e6f72672f736f6c7574696f6e31302f636f6c6c656374696f6e2f762f737461626c652e737667)](https://packagist.org/packages/solution10/collection)[![Total Downloads](https://camo.githubusercontent.com/359e8bd4fa8a28cbafca545090cc85c99fd6f3d8ba9f3a9c421ec3c00cf623a5/68747470733a2f2f706f7365722e707567782e6f72672f736f6c7574696f6e31302f636f6c6c656374696f6e2f646f776e6c6f6164732e737667)](https://packagist.org/packages/solution10/collection)[![Latest Unstable Version](https://camo.githubusercontent.com/01896c982c85d85ebe1ce72b4380caad06784e2be36f4be726b1b6f29b3eeb41/68747470733a2f2f706f7365722e707567782e6f72672f736f6c7574696f6e31302f636f6c6c656374696f6e2f762f756e737461626c652e737667)](https://packagist.org/packages/solution10/collection)[![License](https://camo.githubusercontent.com/e7bd8cb0cf9e6b684f990cd2b2d35e7ca736244780835fe23aae275e7467bc02/68747470733a2f2f706f7365722e707567782e6f72672f736f6c7574696f6e31302f636f6c6c656374696f6e2f6c6963656e73652e737667)](https://packagist.org/packages/solution10/collection)

What does this do?
------------------

[](#what-does-this-do)

Collections, at their core, are implementations of Iterator, ArrayAccess and Countable. But they're also a lot more than that.

Splice subsections of arrays simply by passing keys:

```
$collection = new Collection(array('Apple', 'Orange', 'Banana'));
$subset = $collection['0:1'];
// $subset is now: array('Apple', 'Orange')

$collection = new Collection(array('Apple', 'Orange', 'Banana'));
$subset = $collection['-2:2'];
// $subset contains ('Orange', 'Banana')

$collection = new Collection(array('Apple', 'Orange', 'Banana', 'Grapes'));
$subset = $collection[':LAST'];
// $subset is simply array('Grapes')
```

Quickly and easily Sort

```
$collection = new Collection(array(100, 50, 70, 10));
$collection->sort(Collection::SORT_ASC);
// $collection's order is now: 10, 50, 70, 100

$collection = new Collection(array(
    array(
        'name' => 'Sarah',
        'job' => 'Manager',
    ),
    array(
        'name' => 'Alex',
        'job' => 'Developer',
    ),
    array(
        'name' => 'Tracy',
        'job' => 'HR'
    ),
));
$collection->sortByMember('name', Collection::SORT_ASC);
```

For full feature list, [check out the docs](http://github.com/Solution10/collection/wiki).

Installation
------------

[](#installation)

Install via composer:

```
"require": {
    "solution10/collection": "1.*"
}
```

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

[](#requirements)

- PHP &gt;= 5.3

That's it!

Documentation
-------------

[](#documentation)

See the [Github Wiki](http://github.com/Solution10/collection/wiki)or the [docs/ folder in the repo](http://github.com/solution10/collection/tree/master/docs).

To get api docs; from a checkout of the project run:

```
$ make && open api/index.html

```

License
-------

[](#license)

[MIT](http://github.com/solution10/collection/tree/master/LICENSE.md)

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

[](#contributing)

[Contributors Notes](http://github.com/solution10/collection/tree/master/CONTRIBUTING.md)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

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

Every ~33 days

Total

5

Last Release

4179d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/231595?v=4)[Alex Gisby](/maintainers/alexgisby)[@alexgisby](https://github.com/alexgisby)

---

Top Contributors

[![alexgisby](https://avatars.githubusercontent.com/u/231595?v=4)](https://github.com/alexgisby "alexgisby (23 commits)")

---

Tags

arrayscomposer-packagesdata-structuresphparrayiteratorcollectionsortsplice

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[athari/yalinqo

YaLinqo, a LINQ-to-objects library for PHP

4561.2M5](/packages/athari-yalinqo)[aimeos/map

Easy and elegant handling of PHP arrays as array-like collection objects similar to jQuery and Laravel Collections

4.2k412.9k11](/packages/aimeos-map)[loophp/collection

A (memory) friendly, easy, lazy and modular collection class.

745663.8k13](/packages/loophp-collection)[ginq/ginq

LINQ to Object inspired DSL for PHP

192257.5k3](/packages/ginq-ginq)[graze/sort

A collection of array sorting transforms and functions

12289.6k2](/packages/graze-sort)[chdemko/sorted-collections

Sorted Collections for PHP &gt;= 8.2

222.5M3](/packages/chdemko-sorted-collections)

PHPackages © 2026

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