fast-forward / iterators
A robust and optimized library for advanced PHP Iterators.
Requires
- php: ^8.3
Requires (Dev)
- fast-forward/dev-tools: dev-main
This package is auto-updated.
Last update: 2026-03-31 15:24:54 UTC
README
A robust and optimized library for advanced PHP Iterators.
Enhance your PHP applications with high-performance iterators: lookahead, peeking, filtering, grouping, chunking, and more.
โจ Features
- ๐ Advanced and composable iterator types
- ๐ Lookahead and peeking support
- ๐งผ Filtering and mapping
- ๐งฉ Grouping, chunking, and flattening
- ๐งช Fully tested, mutation safe, and statically analyzed
๐ฆ Installation
Install via Composer:
composer require php-fast-forward/iterators
Requirements: PHP 8.3 or higher
๐ Quickstart
use FastForward\Iterator\ChunkedIteratorAggregate; $data = range(1, 10); $chunked = new ChunkedIteratorAggregate($data, 3); foreach ($chunked as $chunk) { print_r($chunk); }
Expected output:
Array
(
[0] => 1
[1] => 2
[2] => 3
)
Array
(
[0] => 4
[1] => 5
[2] => 6
)
Array
(
[0] => 7
[1] => 8
[2] => 9
)
Array
(
[0] => 10
)
๐ Usage Patterns
All iterators and utilities are available under the FastForward\Iterator namespace. Simply require Composer's autoloader:
require_once 'vendor/autoload.php'; use FastForward\Iterator\ChunkedIteratorAggregate; use FastForward\Iterator\SlidingWindowIteratorIterator; // ...
You can chain, compose, and adapt iterators for a wide variety of data processing tasks.
๐ Documentation & Examples
- ๐ Full Documentation
- ๐งโ๐ป Examples Directory
- Each file demonstrates a specific iterator or pattern:
๐ค Contributing
Contributions, bug reports and suggestions are welcome! Please open an issue or pull request on GitHub.
๐งโ๐ป Author
Felipe Sayรฃo Lobato Abreu
github@mentordosnerds.com
๐ License
This project is licensed under the MIT License.