Repolode
ramsey

ramsey/collection

A PHP library for representing and manipulating collections, with typed collection and map classes inspired by the Java Collections Framework.

Stars
1,203
Forks
54
Open issues
7
Last commit
3 months ago

What is it?

ramsey/collection is a PHP library for representing and manipulating collections of values. It provides object-oriented collection types so PHP code can work with groups of items through a consistent interface rather than raw arrays.

The library draws its design from the Java Collections Framework, so developers familiar with that model will find similar concepts for lists, sets, queues and maps. It is installed through Composer, and usage examples are kept on the project's wiki.

The package is MIT licensed and targets modern PHP versions, with the README noting PHP 8 support through its topic tags and CI setup.

Key features

  • 01Object-oriented collection types for working with groups of values in PHP.
  • 02Design modeled on the Java Collections Framework.
  • 03Installable via Composer as a standard PHP dependency.
  • 04Usage examples are documented on the project wiki.

Use cases

  • Replacing ad hoc PHP arrays with typed collection objects in an application.
  • Building queues, sets or maps with a consistent PHP interface.
  • Adding a collection abstraction to a PHP library or framework.

Quick start

  1. 1

    Install the package with Composer

    composer require ramsey/collection

Topics

FAQ

What is collection?
A PHP library for representing and manipulating collections, with typed collection and map classes inspired by the Java Collections Framework. ramsey/collection is a PHP library for representing and manipulating collections of values. It provides object-oriented collection types so PHP code can work with groups of items through a consistent interface rather than raw arrays.
Is collection free to use? What license does it have?
collection is open source under the MIT license. Check the license terms before using it in commercial products.
Is collection still maintained?
Updated within 6 months. The last commit to collection was on Aug 17, 2026.
What can I use collection for?
Replacing ad hoc PHP arrays with typed collection objects in an application. Building queues, sets or maps with a consistent PHP interface. Adding a collection abstraction to a PHP library or framework.
How do I install collection?
Install the package with Composer: composer require ramsey/collection
Where can I get collection?
The source code and installation instructions are on GitHub: https://github.com/ramsey/collection

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects

A C library for extremely fast non-cryptographic hashing, producing identical 32, 64 and 128-bit hashes across platforms.

Developer Tools#hash-function#checksum#non-cryptographic
11.4K+9 this week946COtherWell maintainedUpdated 10 days ago