Iterator
Classes
An iterator that chains multiple iterable sources together into a single unified iterator.
An extended IteratorIterator that applies a closure transformation to each element during iteration.
Provides a base implementation for iterator aggregate objects that are also countable.
A filter iterator that only accepts files matching specified extensions.
A caching iterator aggregate designed to wrap a generator and cache its results.
An iterator that allows rewinding over a generator by caching its values.
A normalized iterator wrapper that ensures any iterable (array or Traversable) is treated as a standard \Iterator.
An iterator that allows peeking at the next value(s) and stepping back to the previous value(s) without advancing the iteration.
An iterator that enables repeated iteration over a finite subset of an infinite iterator.
Combines multiple iterators into a single iterator, returning arrays of grouped values.
Traits
Functions
Prints a debug representation of an iterable object.
Prints a debug representation of an iterable object.
debugIterable(
iterable<string|int, mixed>
$iterable[,
string|null
$section = null]) : void
Description
This function iterates over a Traversable object and prints each key-value pair,
along with an optional section title. If no section title is provided, the function
uses the class name of the iterable object.
Example Usage:
Parameters
$iterable
:
iterable<string|int, mixed>
Description
the iterable object to debug
$section
:
string|null
=
null
Description
an optional title for the output section
Description
use FastForward\Iterator\debugIterable;
use ArrayIterator;
$iterator = new ArrayIterator(['a' => 1, 'b' => 2, 'c' => 3]);
debugIterable($iterator, 'Example Output');
Output:
=== Example Output ===
Length: 3
Output: [
"a" => 1,
"b" => 2,
0 => 3,
]