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