<?php iterator_to_array(Traversable|array $iterator, bool $preserve_keys = true): array
<?php $layers = []; foreach ($results as $layerName => $result) { $versions = $result->getLayerVersions(true); $versionsArray = iterator_to_array($versions); if (! empty($versionsArray)) { $latestVersion = end($versionsArray);