Skip to content

php-fast-forward/iterators

Repository files navigation

FastForward\Iterators

PHP Version License

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 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

🤝 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.

About

A robust and optimized library for advanced PHP Iterators. Enhance your PHP applications with high-performance iterators, supporting lookahead, peeking, filtering, grouping, and more.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages