emonkak/collection

A collection library as a container for aggregation of objects


Keywords
generator, iterator, array, collection, enumerable
License
MIT

Documentation

Emonkak\Collection

Build Status Coverage Status

A collection library as a container for aggregation of objects.

Requirements

Licence

MIT Licence

Example

// Take five elements from a infinite list of even numbers.
Collection::iterate(0, function($n) { return $n + 1; })
    ->filter(function($n) { return $n % 2 === 0; })
    ->take(5)
    ->each(function($n) { echo $n, PHP_EOL; });
// => 0
//    2
//    4
//    6
//    8

Documentation

Please see Wiki. (but wiki pages are Japanese only)