iterator_to_array
spatie/ignition
Supported Versions: PHP 5 >= 5.1.0, PHP 7, PHP 8
Copy the iterator into an array
<?php iterator_to_array
(
Traversable
|array
$iterator
,
bool $preserve_keys
=
true
): array