iterator_count()
function iterator_count(traversable $iterator): int
Count the elements in an iterator.
Parameters:
$iterator(traversable)
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_count.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how iterator_count is implemented in the compiler, see the internals page.