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

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

webcodr/collection
==================

Collection library for PHP

2.1.4(12y ago)61691MITJavaScriptPHP &gt;=5.4

Since Mar 2Pushed 12y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (11)Used By (1)

Collection
==========

[](#collection)

[![Build Status](https://camo.githubusercontent.com/88a78cd7a29bb674d8941374dbb8a6a16bd33858d2df6eb00283aa2d29b973a1/68747470733a2f2f7472617669732d63692e6f72672f576562436f64722f436f6c6c656374696f6e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/WebCodr/Collection)

[![PHP version](https://camo.githubusercontent.com/847a9d1f94cbb79f4f32a4266c44cf4e743caf831baa396129715dcecb15ca99/68747470733a2f2f62616467652e667572792e696f2f70682f576562436f6472253246436f6c6c656374696f6e2e706e67)](http://badge.fury.io/ph/WebCodr%2FCollection)

### A set of array replacement classes for PHP

[](#a-set-of-array-replacement-classes-for-php)

### Requirements

[](#requirements)

- PHP 5.4
- Composer

### Setup

[](#setup)

#### Add Collection to your project

[](#add-collection-to-your-project)

```
$ php composer.phar require webcodr/collection:2.*
```

### Basic information

[](#basic-information)

Collections provides two classes: MutableMap and ArrayMap

ArrayMap extends MutableMap with an implementation of the SPL interface ArrayAccess

MutableMap implements the SPL interfaces IteratorAggregate and Countable.

Both classes support a fluent interface with method chaining. Methods without a specific return value like `get()` or `has()` will return in the object itself.

### Usage

[](#usage)

A little code example says more than 1,000 words, so here we go:

The complete documentation is available in doc directory. (it's little buggy due to the use of traits)

```
