iterator_to_array()
function iterator_to_array(traversable $iterator, bool $preserve_keys = true): array
Copy the iterator into an array.
Parameters:
$iterator(traversable)$preserve_keys(bool), defaulttrue, optional
Returns: array
Availability
| Compiled (AOT) | Magician (eval) |
|---|---|
| Available | Available |
No examples yet. Check examples/ and showcases/ for usage patterns.
Internals
For how iterator_to_array is implemented in the compiler, see the internals page.