Welcome, PHP 7.1!
All familiar functions and interfaces, but with iterable
type hints all over the place.
As a consequence, Pipeline\take()
can now take not only iterators, but plain old arrays too. Arrays are handled eagerly, which is a point to keep in mind. For example:
$foo = take([0, 0, 1, 2, 3])->filter();
// at this point $foo contains exactly [1, 2, 3]
Also because of that Pipeline\fromArray()
became useless and is tagged for deprecation in favour of take()
. Still available for API compatibility.
Speaking of API compatibility, all previous code should work just as fine.