spindle/stream

Iterator builder like Java8 Stream API

dev-master 2016-06-19 02:16 UTC

This package is not auto-updated.

Last update: 2024-11-02 16:51:07 UTC


README

Iterator builder like Java8' Stream API

<?php
use Spindle\Stream;

Stream::_(range(0, 9))
    ->filter('$_ > 5')
    ->distinct()
    ->map('$_ * 5')
    ->export($stream);

foreach ($stream as $v) {
    echo $v, PHP_EOL;
}

Install

$ composer require 'spindle/stream:*'

License

Creative Commons Zero 1.0 Universal (Public Domain)