1--TEST-- 2SPL: RecursiveTreeIterator methods 3--INI-- 4error_reporting=E_ALL&~E_NOTICE 5--FILE-- 6<?php 7 8$ary = array( 9 0 => array( 10 "a", 11 1, 12 ), 13 "a" => array( 14 2, 15 "b", 16 3 => array( 17 4, 18 "c", 19 ), 20 "3" => array( 21 4, 22 "c", 23 ), 24 ), 25); 26 27$it = new RecursiveTreeIterator(new RecursiveArrayIterator($ary)); 28foreach($it as $k => $v) { 29 echo '[' . $it->key() . '] => ' . $it->getPrefix() . $it->getEntry() . $it->getPostfix() . "\n"; 30} 31?> 32===DONE=== 33--EXPECTF-- 34[0] => |-Array 35[0] => | |-a 36[1] => | \-1 37[a] => \-Array 38[0] => |-2 39[1] => |-b 40[3] => \-Array 41[0] => |-4 42[1] => \-c 43===DONE=== 44