XBRL.php
public function processAllNodes( &$nodes, $callback = false )
	{
		if ( ! $callback ) return; // Nothing to do except waste time

		foreach( $nodes as $id => $node )
		{
			$result = $callback( $node, $id );
			if ( $result === false ) return false;

			if ( ! isset( $node['children'] ) ) continue;

			$result = $this->processAllNodes( $node['children'], $callback );
			if ( $result === false ) return false;
		}
	}
public function processAllNodes( &$nodes, $callback = false )
	{
		if ( ! $callback ) return; // Nothing to do except waste time

		foreach( $nodes as $id => $node )
		{
			$result = $callback( $node, $id );
			if ( $result === false ) return false;

			if ( ! isset( $node['children'] ) ) continue;

			$result = $this->processAllNodes( $node['children'], $callback );
			if ( $result === false ) return false;
		}
	}
public function processAllNodes ( & $ nodes , $ callback = false ) { if ( ! $ callback ) return ; // Nothing to do except waste time
 foreach ( $ nodes as $ id => $ node ) { $ result = $ callback ( $ node , $ id ) ; if ( $ result === false ) return false ; if ( ! isset ( $ node [ 'children' ] ) ) continue ; $ result = $ this -> processAllNodes ( $ node [ 'children' ] , $ callback ) ; if ( $ result === false ) return false ; } }
Iterate over a set of nodes calling a callback for each one

@param array $nodes		A root node collection to process
@param string $callback	A function called for each node.  The node and id are passed.
If the function returns false the processing will stop
Iterate over a set of nodes calling a callback for each one