PHPackages                             ramsey/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. [Queues &amp; Workers](/categories/queues)
4. /
5. ramsey/collection

ActiveLibrary[Queues &amp; Workers](/categories/queues)

ramsey/collection
=================

A PHP library for representing and manipulating collections.

2.1.1(1y ago)1.2k513.6M↓38.1%55[4 issues](https://github.com/ramsey/collection/issues)[1 PRs](https://github.com/ramsey/collection/pulls)20MITPHPPHP ^8.1CI passing

Since Oct 27Pushed 1mo ago9 watchersCompare

[ Source](https://github.com/ramsey/collection)[ Packagist](https://packagist.org/packages/ramsey/collection)[ RSS](/packages/ramsey-collection/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (17)Versions (20)Used By (20)

ramsey/collection
=================

[](#ramseycollection)

 **A PHP library for representing and manipulating collections.**

 [![Source Code](https://camo.githubusercontent.com/cebc237b228446aeaac0aa25c409a2b7fe74c2126f27742b7b01fe36be69d0ea/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d72616d7365792f636f6c6c656374696f6e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/ramsey/collection) [![Download Package](https://camo.githubusercontent.com/9a2f29141f79bb94c5f943b5330f0624f9c92f899f2ba3183b401d56ce819150/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72616d7365792f636f6c6c656374696f6e2e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/ramsey/collection) [![PHP Programming Language](https://camo.githubusercontent.com/efd34150a0e0c9109a4f20ce7186761a73f09f7b69ce64e79b1823d2c57b0065/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f72616d7365792f636f6c6c656374696f6e2e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d253233383839324246)](https://php.net) [![Read License](https://camo.githubusercontent.com/fd417ad0c495885df6bdbe41ebaa22775b31ff64553fa2583accc78f535d587c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f72616d7365792f636f6c6c656374696f6e2e7376673f7374796c653d666c61742d73717561726526636f6c6f72423d6461726b6379616e)](https://github.com/ramsey/collection/blob/master/LICENSE) [![Build Status](https://camo.githubusercontent.com/d77918a1f0f48e97b94eea85b3d24a514ace0f3a3c5f767626e6adcc03a2391a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f72616d7365792f636f6c6c656374696f6e2f636f6e74696e756f75732d696e746567726174696f6e2e796d6c3f6272616e63683d6d61696e266c6f676f3d676974687562267374796c653d666c61742d737175617265)](https://github.com/ramsey/collection/actions/workflows/continuous-integration.yml) [![Codecov Code Coverage](https://camo.githubusercontent.com/c62321c861acb32e2f28f8c4a16f33d3df8d44c4b83155577d51ad2573868e6f/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f72616d7365792f636f6c6c656374696f6e3f6c6162656c3d636f6465636f76266c6f676f3d636f6465636f76267374796c653d666c61742d737175617265)](https://codecov.io/gh/ramsey/collection)

About
-----

[](#about)

ramsey/collection is a PHP library for representing and manipulating collections.

Much inspiration for this library came from the [Java Collections Framework](http://docs.oracle.com/javase/8/docs/technotes/guides/collections/index.html).

This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). By participating in this project and its community, you are expected to uphold this code.

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

[](#installation)

Install this package as a dependency using [Composer](https://getcomposer.org).

```
composer require ramsey/collection
```

Usage
-----

[](#usage)

Examples of how to use this library may be found in the [Wiki pages](https://github.com/ramsey/collection/wiki/Examples).

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

[](#contributing)

Contributions are welcome! To contribute, please familiarize yourself with [CONTRIBUTING.md](CONTRIBUTING.md).

Coordinated Disclosure
----------------------

[](#coordinated-disclosure)

Keeping user information safe and secure is a top priority, and we welcome the contribution of external security researchers. If you believe you've found a security issue in software that is maintained in this repository, please read [SECURITY.md](https://github.com/ramsey/collection/blob/main/SECURITY.md) for instructions on submitting a vulnerability report.

Copyright and License
---------------------

[](#copyright-and-license)

The ramsey/collection library is copyright © [Ben Ramsey](https://benramsey.com)and licensed for use under the terms of the MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

73

—

ExcellentBetter than 100% of packages

Maintenance71

Regular maintenance activity

Popularity80

Widely adopted with strong download metrics

Community45

Growing community involvement

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 60.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 ~202 days

Recently: every ~315 days

Total

18

Last Release

444d ago

Major Versions

0.3.0 → 1.0.02018-12-31

1.3.0 → 2.0.02022-12-31

PHP version history (6 changes)0.1.0PHP &gt;=5.6

1.0.0PHP ^7.2

1.1.0PHP ^7.2 || ^8

1.2.0PHP ^7.3 || ^8

1.3.0PHP ^7.4 || ^8.0

2.0.0PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![ramsey](https://avatars.githubusercontent.com/u/42941?v=4)](https://github.com/ramsey "ramsey (169 commits)")[![eclipxe13](https://avatars.githubusercontent.com/u/1266852?v=4)](https://github.com/eclipxe13 "eclipxe13 (30 commits)")[![icanhazstring](https://avatars.githubusercontent.com/u/883543?v=4)](https://github.com/icanhazstring "icanhazstring (15 commits)")[![SimoTod](https://avatars.githubusercontent.com/u/8427737?v=4)](https://github.com/SimoTod "SimoTod (13 commits)")[![zf2timo](https://avatars.githubusercontent.com/u/3073381?v=4)](https://github.com/zf2timo "zf2timo (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![K-Phoen](https://avatars.githubusercontent.com/u/66958?v=4)](https://github.com/K-Phoen "K-Phoen (5 commits)")[![AkshatSrivastava2](https://avatars.githubusercontent.com/u/21310606?v=4)](https://github.com/AkshatSrivastava2 "AkshatSrivastava2 (3 commits)")[![raphaelts3](https://avatars.githubusercontent.com/u/3309716?v=4)](https://github.com/raphaelts3 "raphaelts3 (3 commits)")[![Chris53897](https://avatars.githubusercontent.com/u/7104259?v=4)](https://github.com/Chris53897 "Chris53897 (2 commits)")[![pmlkvch](https://avatars.githubusercontent.com/u/84413206?v=4)](https://github.com/pmlkvch "pmlkvch (2 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")[![smitmartijn](https://avatars.githubusercontent.com/u/6500836?v=4)](https://github.com/smitmartijn "smitmartijn (1 commits)")[![tcarrio](https://avatars.githubusercontent.com/u/8659099?v=4)](https://github.com/tcarrio "tcarrio (1 commits)")[![yannoff](https://avatars.githubusercontent.com/u/20049273?v=4)](https://github.com/yannoff "yannoff (1 commits)")[![Lewiscowles1986](https://avatars.githubusercontent.com/u/2605791?v=4)](https://github.com/Lewiscowles1986 "Lewiscowles1986 (1 commits)")[![error17191](https://avatars.githubusercontent.com/u/9117744?v=4)](https://github.com/error17191 "error17191 (1 commits)")[![finagin](https://avatars.githubusercontent.com/u/11045296?v=4)](https://github.com/finagin "finagin (1 commits)")[![freezy-sk](https://avatars.githubusercontent.com/u/661637?v=4)](https://github.com/freezy-sk "freezy-sk (1 commits)")[![freezysko](https://avatars.githubusercontent.com/u/661637?v=4)](https://github.com/freezysko "freezysko (1 commits)")

---

Tags

arraycollectionhashmapphpphp8queuesetarrayhashqueuemapsetcollection

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[phootwork/collection

The phootwork library fills gaps in the php language and provides better solutions than the existing ones php offers.

3927.1M15](/packages/phootwork-collection)[phpcollection/phpcollection

General-Purpose Collection Library for PHP

96764.5M34](/packages/phpcollection-phpcollection)[aimeos/map

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

4.3k443.7k14](/packages/aimeos-map)[seboettg/collection

Collection is a set of useful PHP wrapper classes for arrays, similar to Java Collection. Contains ArrayList, Stack, Queue.

101.3M4](/packages/seboettg-collection)[chdemko/sorted-collections

Sorted Collections for PHP &gt;= 8.4

222.6M3](/packages/chdemko-sorted-collections)[graze/data-structure

Data collections and containers

12293.1k9](/packages/graze-data-structure)

PHPackages © 2026

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