For instance: ```php $any = (new Iterator\Map($data)).any(function ($item) { return 0 === $item % 2; }) ``` instead of: ```php $any = false; foreach ($data as $datum) { if (0 === $item % 2) { $any = true; break; } } ``` The first is less error-prone, normally bug-free, and easier to read. We can optimise it a lot too. See the Rust iterator API: https://doc.rust-lang.org/std/iter/trait.Iterator.html. We should benchmark results with manual implementation vs. [`iterator_apply`](http://php.net/iterator_apply). <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40281855-import-rust-iterator-methods-into-this-library?utm_campaign=plugin&utm_content=tracker%2F724177&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F724177&utm_medium=issues&utm_source=github). </bountysource-plugin>
For instance:
instead of:
The first is less error-prone, normally bug-free, and easier to read. We can optimise it a lot too.
See the Rust iterator API: https://doc.rust-lang.org/std/iter/trait.Iterator.html.
We should benchmark results with manual implementation vs.
iterator_apply.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.