- array_walk: documentation ( source)
- iterator_to_array: documentation ( source)
<?php
$dom = new DOMDocument();
$dom->loadXML('<root><stuff/><stuff/></root>');
$nodes = iterator_to_array($dom->getElementsByTagName('stuff'));
array_walk($nodes, 'var_dump'); // expected int(2) from $nodes->length