NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #2363 most downloaded on Packagist
Iteration primitives using generators
Latest stable
v2.4.1
Last release 3 years ago
no release in 18 months
Ships fairly regularly
a new release about every 11 months
Nearly every release is documented
notes for 12 of 13 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
13 releases · first in 2014
Drag across the ruler to compare, or tap a release to open it.
Improve typehint for toArray() from array to list .
toArray() from array<T> to list<T>.Added iter\tap() function (https://github.com/nikic/iter/pull/95).
iter\tap() function (https://github.com/nikic/iter/pull/95).Your coding agent can read these notes before it upgrades. Set up the MCP server →
This release adds more precise phpdoc type annotations, using templates and specifying callable signatures (#93).
This release adds more precise phpdoc type annotations, using templates and specifying callable signatures (#93).
Compatibility with PHP 8.1.
Added iter\slice() method (#80). This works like explode() but produces an iterator.
iter\slice() method (#80). This works like explode() but produces an iterator.iter\mapWithKeys() method (#81). This works like iter\map() but also passes keys as second parameter to the callable.This release makes iter compatible with PHP 7.4 by renaming the iter\fn namespace to iter\func.
This release makes iter compatible with PHP 7.4 by renaming the iter\fn namespace to iter\func.
iterable types. (#52)iter\fn namespace has been renamed to iter\func. This is necessary for PHP 7.4 compatibility. (#79)$preserveKeys = false in chunk() and add chunkWithKeys() function.Added iter\enumerate() function (#43).
iter\enumerate() function (#43).iter\isEmpty() function (#46).$preserveKeys parameter to iter\chunk() (#42).Added $levels argument for flatten().
$levels argument for flatten().flatMap() function.Fixed infinite loop when iter\zip() is called without arguments.
iter\zip() is called without arguments.iter\flatten() function now preserves keys.iter\recurse() function. Example use is iter\recurse('iter\toArray', $data) which will recursively convert an iterator to array.Added Iterator iter\product(...$iterables): Returns the cartesian product iterator of the passed iterators.
Iterator iter\product(...$iterables):bool iter\isIterable(mixed $value):$key parameter to the callback of reduce() and reductions(). (#28)<=> to fn\operator(). It is also supported on PHP versions that do not natively provide a <=> operator.mixed search(callable $predicate, iterable $iterable): Returns the first value from $iterable which satisfies $predicate, or null if no such element e
iter functions:
mixed search(callable $predicate, iterable $iterable):$iterable which satisfies $predicate, or null if no such element exists.Iterator reductions(callable $function, iterable $iterable, mixed $startValue = null):**) to iter\fn\operator(). Support is available also on older PHP versions which do not have an actual ** operator.Iterator mapKeys(callable $function, iterable $iterable)
Added iter functions:
Iterator mapKeys(callable $function, iterable $iterable)Iterator reindex(callable $function, iterable $iterable)Iterator chunk(iterable $iterable, int $size)Iterator flip(iterable $iterable)string join(string $separator, iterable $iterable)Added iter\fn functions:
function nested_index(...$indices)Nothing published for this version
One column per quarter.