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

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

managur/collection
==================

A base collection class to build your object collections on top of

1.14.0(3mo ago)74.1k↓33.3%2[3 issues](https://github.com/managur/Collection/issues)MITPHPPHP 8.0 - 8.5CI passing

Since Oct 6Pushed 3mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (2)Versions (23)Used By (0)

[![Managur](managur_logo.png)](managur_logo.png)
Collections
============================================================

[](#collections)

[![CI](https://github.com/managur/Collection/workflows/CI/badge.svg)](https://github.com/managur/Collection/actions?query=workflow%3ACI)[![Latest Stable Version](https://camo.githubusercontent.com/27adfd009199bbd234ed8e879ed0d1722425a5cbd4c0692d600f3ca8b4d6651a/68747470733a2f2f706f7365722e707567782e6f72672f6d616e616775722f636f6c6c656374696f6e2f762f737461626c65)](https://packagist.org/packages/managur/collection)[![License](https://camo.githubusercontent.com/d165d8f1db8c681d39df28915738891df267d2c690b967dddd73f5b15f8546ca/68747470733a2f2f706f7365722e707567782e6f72672f6d616e616775722f636f6c6c656374696f6e2f6c6963656e7365)](https://packagist.org/packages/managur/collection)[![Coverage Status](https://camo.githubusercontent.com/9ec3b7f9389023c137b7d471b7e2e8c184d42b458d4c8479bfb5286b32057613/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d616e616775722f436f6c6c656374696f6e2f62616467652e737667)](https://coveralls.io/github/managur/Collection)[![Maintainability](https://camo.githubusercontent.com/0eb5485e56a7aeba60d6b7ee423a969d2f45bb9373fb22d5e6775c1671716c26/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f63663966633232363634643765636134323531342f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/managur/Collection/maintainability)

*Managur Collections* is a library that provides a fully featured collection object to PHP.

What are collections?
---------------------

[](#what-are-collections)

Collections are similar to an array in PHP, but can be restricted to a specific type, both at the index and value level.

Collections also provide some built in functionality, such as being able to easily search the contents for a particular value, perform filtering, and to iterate through within a closed scope.

Let's take a look at some examples:

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

[](#installation)

Before we can use Managur Collections, we need to install it. The recommended method is using PHP's package manager, Composer:

```
$ composer require managur/collection
```

Example Usage
-------------

[](#example-usage)

*We'll assume that you have installed via Composer, and therefore are using Composer's autoloader.*

There are two ways in that you can use Managur Collections. The first is using its class constructor, as follows:

```
