Skip to content

Instantly share code, notes, and snippets.

@pumatertion
Created September 10, 2013 09:49
Show Gist options
  • Save pumatertion/6507242 to your computer and use it in GitHub Desktop.
Save pumatertion/6507242 to your computer and use it in GitHub Desktop.
Usage of Recursive Iterators
<?php
$array = array(
'foo' => array(
'bar' => array(
'baz' => 'bar'
)
)
);
$arrayObject = new \ArrayObject($array);
$arrayObject->setIteratorClass('\RecursiveArrayIterator');
$iterator = new \RecursiveIteratorIterator($arrayObject->getIterator());
while($iterator->valid()){
\TYPO3\Flow\var_dump($iterator->current(),$iterator->key());
$iterator->next();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment