All Versions
9
Latest Version
Avg Release Cycle
306 days
Latest Release
988 days ago
Changelog History
Changelog History
-
v2.1.0 Changes
September 19, 2020 -
v2.0.0 Changes
May 30, 2019๐ This release makes iter compatible with PHP 7.4 by renaming the
iter\fn
namespace toiter\func
.- PHP >= 7.1 is now required. Functions are annotated with
iterable
types. (#52) - The
iter\fn
namespace has been renamed toiter\func
. This is necessary for PHP 7.4 compatibility. (#79) - 0๏ธโฃ Default
$preserveKeys = false
in chunk() and add chunkWithKeys() function. - Avoid advancing by one additional iteration in slice(). (#75)
- PHP >= 7.1 is now required. Functions are annotated with
-
v1.6.0 Changes
November 10, 2017 -
v1.5.0 Changes
April 26, 2017- โ Added
$levels
argument forflatten()
. - โ Added
flatMap()
function.
- โ Added
-
v1.4.0 Changes
September 27, 2016- ๐ Fixed infinite loop when
iter\zip()
is called without arguments. - โ Added additional error checks for various "length" and "count" parameters (usually disallowing negative numbers).
- The
iter\flatten()
function now preserves keys. - โ Added an
iter\recurse()
function. Example use isiter\recurse('iter\toArray', $data)
which will recursively convert an iterator to array.
- ๐ Fixed infinite loop when
-
v1.3.0 Changes
October 21, 2015- โ Added
Iterator iter\product(...$iterables)
:
Returns the cartesian product iterator of the passed iterators. (#25) - โ Added
bool iter\isIterable(mixed $value)
:
Returns whether the value is an array or Traversable. - โ Added
$key
parameter to the callback ofreduce()
andreductions()
. (#28) - โ Added support for
<=>
tofn\operator()
. It is also supported on PHP versions that do not natively provide a<=>
operator. - All functions now validate that inputs are iterables.
- โ Added
-
v1.2.0 Changes
March 08, 2015- โ Added new
iter
functions:mixed search(callable $predicate, iterable $iterable)
:
Returns the first value from$iterable
which satisfies$predicate
, ornull
if no such element exists.Iterator reductions(callable $function, iterable $iterable, mixed $startValue = null)
:
Returns an iterator which contains the intermediate values produced by applying a reduction function to an iterator. Can for example be used to compute cumulative sums.
- ๐ Added support for the power operator (
**
) toiter\fn\operator()
. Support is available also on older PHP versions which do not have an actual**
operator.
- โ Added new
-
v1.1.0 Changes
March 27, 2014โ 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)
-
v1.0.0 Changes
January 07, 2014๐ First release :)