Strictly typed iterator for Rust lovers in PHP.
- PHP 8.1+
- PHPStan 1.9+
composer require siketyan/phpiter
use Siketyan\PhpIter\Iter;
Iter::of([1, 2, 3, 4, 5])
->map(fn ($value) => $value * 10)
->toArray();
// -> [10, 20, 30, 40, 50]
- all
- any
- chain
- cloned
- collect
- count
- cycle
- enumerate
- eq
- filter
- filter_map
- find
- find_map
- flat_map
- flatten
- fold
- for_each
- fuse
- inspect
- last
- nth
- partition
- peekable
- position
- product
- reduce
- rev
- rposition
- scan
- size_hint
- skip
- skip_while
- step_by
- sum
- take
- take_while
- try_fold
- try_for_each
- unzip
- zip