Iteration primitives using generators is a PHP library that provides iteration primitives implemented with generators. It offers familiar functional operations such as map, filter, reduce, zip, chain, slice, take, drop, flatten, and chunk for arbitrary iterable values. Unlike many array-only helpers, it accepts arrays, traversables, iterators, and aggregates. Because the operations are lazy, it can process sequences without eagerly building full intermediate arrays. The library also includes tools for converting results, checking iterability, joining values, searching, counting, and working with rewindable generator variants. Overall, it is useful for PHP developers who want expressive iterable pipelines with minimal overhead and generator-based execution.
Features
- Generator-based iteration primitives for PHP
- Support for arrays, traversables, iterators, and aggregates
- Lazy map, filter, reduce, zip, chain, and product operations
- Slicing, taking, dropping, flattening, and chunking helpers
- Conversion helpers for arrays, keyed arrays, joins, and counts
- Rewindable variants for reusable generator workflows