1--TEST-- 2SPL: RecursiveTreeIterator::setPostfix() 3--CREDITS-- 4Joshua Thijssen (jthijssen@noxlogic.nl) 5--FILE-- 6<?php 7 8$arr = 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 RecursiveArrayIterator($arr); 28$it = new RecursiveTreeIterator($it); 29 30echo "----\n"; 31echo $it->getPostfix(); 32echo "\n\n"; 33 34echo "----\n"; 35$it->setPostfix("POSTFIX"); 36echo $it->getPostfix(); 37echo "\n\n"; 38 39echo "----\n"; 40foreach($it as $k => $v) { 41 echo "[$k] => $v\n"; 42} 43 44echo "----\n"; 45$it->setPostfix(""); 46echo $it->getPostfix(); 47echo "\n\n"; 48 49echo "----\n"; 50foreach($it as $k => $v) { 51 echo "[$k] => $v\n"; 52} 53 54 55 56?> 57--EXPECT-- 58---- 59 60 61---- 62POSTFIX 63 64---- 65[0] => |-ArrayPOSTFIX 66[0] => | |-aPOSTFIX 67[1] => | \-1POSTFIX 68[a] => \-ArrayPOSTFIX 69[0] => |-2POSTFIX 70[1] => |-bPOSTFIX 71[3] => \-ArrayPOSTFIX 72[0] => |-4POSTFIX 73[1] => \-cPOSTFIX 74---- 75 76 77---- 78[0] => |-Array 79[0] => | |-a 80[1] => | \-1 81[a] => \-Array 82[0] => |-2 83[1] => |-b 84[3] => \-Array 85[0] => |-4 86[1] => \-c 87