iterator_apply()
function iterator_apply(traversable $iterator, callable $callback, array $args = null): int
Call a function for every element in an iterator.
Parameters:
$iterator(traversable)$callback(callable)$args(array), defaultnull, optional
Returns: int
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/array/iterator_apply.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how iterator_apply is implemented in the compiler, see the internals page.