PHPackages                             kuria/collections - 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. kuria/collections

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

kuria/collections
=================

Object-oriented collection structures

v2.0.0(7y ago)121MITPHPPHP &gt;=7.1

Since May 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/kuria/collections)[ Packagist](https://packagist.org/packages/kuria/collections)[ RSS](/packages/kuria-collections/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Collections
===========

[](#collections)

Object-oriented collection structures.

[![https://travis-ci.com/kuria/collections.svg?branch=master](https://camo.githubusercontent.com/3400dde301b531995d7071b5c9a84b9a78e5616de8c12bfdc5c95db6ba1d17b4/68747470733a2f2f7472617669732d63692e636f6d2f6b757269612f636f6c6c656374696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/kuria/collections)Contents

- [Features](#features)
- [Requirements](#requirements)
- [Collection](#collection)
    - [Creating a new collection](#creating-a-new-collection)
        - [Empty collection](#empty-collection)
        - [Using an existing iterable](#using-an-existing-iterable)
        - [Using varargs](#using-varargs)
    - [Collection method overview](#collection-method-overview)
        - [Static methods](#static-methods)
        - [Instance methods](#instance-methods)
    - [Array access and iteration](#array-access-and-iteration)
- [Map](#map)
    - [Creating a new map](#creating-a-new-map)
        - [Empty map](#empty-map)
        - [Using an existing iterable](#id2)
    - [Map method overview](#map-method-overview)
        - [Static methods](#id3)
        - [Instance methods](#id4)
    - [Array access and iteration](#id5)

[Features](#id6)
----------------

[](#features)

- `Collection` - list of values with sequential integer indexes
- `Map` - key-value map

[Requirements](#id7)
--------------------

[](#requirements)

- PHP 7.1+

[Collection](#id8)
------------------

[](#collection)

The `Collection` class implements a list of values with sequential integer indexes.

It also implements `Countable`, `ArrayAccess` and `IteratorAggregate`.

### [Creating a new collection](#id9)

[](#creating-a-new-collection)

#### [Empty collection](#id10)

[](#empty-collection)

```
