PHPackages                             cakephp/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. [Framework](/categories/framework)
4. /
5. cakephp/collection

ActiveLibrary[Framework](/categories/framework)

cakephp/collection
==================

Work easily with arrays and iterators by having a battery of utility traversal methods

5.3.3(2mo ago)899.9M↓13.3%59MITPHPPHP &gt;=8.2

Since Oct 31Pushed 1mo ago29 watchersCompare

[ Source](https://github.com/cakephp/collection)[ Packagist](https://packagist.org/packages/cakephp/collection)[ Docs](https://cakephp.org)[ RSS](/packages/cakephp-collection/feed)WikiDiscussions 5.x Synced 1mo ago

READMEChangelogDependenciesVersions (340)Used By (9)

[![Total Downloads](https://camo.githubusercontent.com/3c973df86f6d0350008e8cab3027e4b0fb734e31e2fe50adbec1be1f1259d886/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616b657068702f636f6c6c656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cakephp/collection)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)

CakePHP Collection Library
==========================

[](#cakephp-collection-library)

The collection classes provide a set of tools to manipulate arrays or Traversable objects. If you have ever used underscore.js, you have an idea of what you can expect from the collection classes.

Usage
-----

[](#usage)

Collections can be created using an array or Traversable object. A simple use of a Collection would be:

```
use Cake\Collection\Collection;

$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);

// Create a new collection containing elements
// with a value greater than one.
$overOne = $collection->filter(function ($value, $key, $iterator) {
    return $value > 1;
});
```

The `Collection\CollectionTrait` allows you to integrate collection-like features into any Traversable object you have in your application as well.

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

[](#documentation)

Please make sure you check the [official documentation](https://book.cakephp.org/5/en/core-libraries/collections.html)

###  Health Score

73

—

ExcellentBetter than 100% of packages

Maintenance87

Actively maintained with recent releases

Popularity58

Moderate usage in the ecosystem

Community36

Small or concentrated contributor base

Maturity95

Battle-tested with a long release history

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~12 days

Recently: every ~23 days

Total

333

Last Release

62d ago

Major Versions

4.4.9 → 5.0.0-beta12022-12-03

4.5.0-RC1 → 5.0.02023-08-13

4.5.7 → 5.0.22023-10-16

4.6.3 → 5.3.0-RC12025-11-04

5.x-dev → 6.x-dev2026-03-17

PHP version history (7 changes)3.4.8PHP &gt;=5.6.0

4.0.0-beta1PHP &gt;=7.2.0

3.9.7PHP &gt;=5.6.0,&lt;8.0.0

4.4.0-RC1PHP &gt;=7.4.0

5.0.0-beta1PHP &gt;=8.1

5.3.0-RC1PHP &gt;=8.2

6.x-devPHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23666?v=4)[CakePHP](/maintainers/cakephp)[@cakephp](https://github.com/cakephp)

---

Top Contributors

[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (170 commits)")[![markstory](https://avatars.githubusercontent.com/u/24086?v=4)](https://github.com/markstory "markstory (133 commits)")[![lorenzo](https://avatars.githubusercontent.com/u/37621?v=4)](https://github.com/lorenzo "lorenzo (126 commits)")[![othercorey](https://avatars.githubusercontent.com/u/24221186?v=4)](https://github.com/othercorey "othercorey (79 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (66 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (15 commits)")[![LordSimal](https://avatars.githubusercontent.com/u/9105243?v=4)](https://github.com/LordSimal "LordSimal (15 commits)")[![antograssiot](https://avatars.githubusercontent.com/u/4977112?v=4)](https://github.com/antograssiot "antograssiot (13 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (11 commits)")[![hytromo](https://avatars.githubusercontent.com/u/131824?v=4)](https://github.com/hytromo "hytromo (7 commits)")[![Harfusha](https://avatars.githubusercontent.com/u/47174548?v=4)](https://github.com/Harfusha "Harfusha (7 commits)")[![Iandenh](https://avatars.githubusercontent.com/u/2911923?v=4)](https://github.com/Iandenh "Iandenh (6 commits)")[![letstalk-nl](https://avatars.githubusercontent.com/u/9513230?v=4)](https://github.com/letstalk-nl "letstalk-nl (5 commits)")[![jozefgrencik](https://avatars.githubusercontent.com/u/1457296?v=4)](https://github.com/jozefgrencik "jozefgrencik (4 commits)")[![chinpei215](https://avatars.githubusercontent.com/u/7399393?v=4)](https://github.com/chinpei215 "chinpei215 (4 commits)")[![dakota](https://avatars.githubusercontent.com/u/83255?v=4)](https://github.com/dakota "dakota (4 commits)")[![brenoroosevelt](https://avatars.githubusercontent.com/u/24551532?v=4)](https://github.com/brenoroosevelt "brenoroosevelt (2 commits)")[![darensipes](https://avatars.githubusercontent.com/u/840593?v=4)](https://github.com/darensipes "darensipes (2 commits)")[![mylux](https://avatars.githubusercontent.com/u/11030522?v=4)](https://github.com/mylux "mylux (2 commits)")[![robertpustulka](https://avatars.githubusercontent.com/u/7437773?v=4)](https://github.com/robertpustulka "robertpustulka (2 commits)")

---

Tags

cakephpcollectionsiteratorsarrays

### Embed Badge

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

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

###  Alternatives

[composer/installers

A multi-framework Composer library installer

1.4k136.0M6.0k](/packages/composer-installers)[cakephp/debug_kit

CakePHP Debug Kit

86514.0M138](/packages/cakephp-debug-kit)[cakephp/utility

CakePHP Utility classes such as Inflector, String, Hash, and Security

12127.1M63](/packages/cakephp-utility)[friendsofcake/bootstrap-ui

Bootstrap front-end framework support for CakePHP

3492.1M32](/packages/friendsofcake-bootstrap-ui)[cakephp/database

Flexible and powerful Database abstraction library with a familiar PDO-like API

9824.6M33](/packages/cakephp-database)[cakephp/migrations

Database Migration plugin for CakePHP

13912.0M222](/packages/cakephp-migrations)

PHPackages © 2026

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