Examples

The examples/ directory is one of the fastest ways to understand the library. Each script is small, focused, and easy to run in isolation.

Suggested reading map

Example file What to look for
chain-iterator.php sequential combination of multiple iterables
chunked-iterator-aggregate.php fixed-size batching with different chunk sizes
closure-factory-iterator-aggregate.php factory-based lazy iterable creation
closure-iterator-iterator.php value transformation with closures
consecutive-group-iterator.php grouping adjacent runs
file-extension-filter-iterator.php filtering filesystem entries by extension
generator-caching-iterator-aggregate.php replaying generator-backed aggregates
generator-rewindable-iterator.php rewinding generator output and repeating it
group-by-iterator-iterator.php full-dataset grouping by computed keys
interleave-iterator-iterator.php round-robin traversal and mixed key behavior
lookahead-iterator.php peeking ahead and behind without consuming values
range-iterator.php integer, float, and boundary-aware ranges
repeatable-iterator-iterator.php controlled repetition with limits and offsets
sliding-window-iterator-iterator.php overlapping windows of different sizes
trim-iterator-iterator.php whitespace trimming and custom character masks
unique-iterator-iterator.php strict and non-strict deduplication
zip-iterator-iterator.php lockstep combination of several iterables