1--TEST-- 2SPL: RecursiveTreeIterator::setPrefixPart() 3--INI-- 4error_reporting=E_ALL&~E_NOTICE 5--FILE-- 6<?php 7 8$ary = array( 9 "a" => array("b"), 10 "c" => array("d"), 11); 12 13$it = new RecursiveArrayIterator($ary); 14$it = new RecursiveTreeIterator($it); 15for($i = 0; $i < 6; ++$i) { 16 $it->setPrefixPart($i, $i); 17} 18foreach($it as $k => $v) { 19 echo "[$k] => $v\n"; 20} 21try { 22 $it->setPrefixPart(-1, ""); 23 $it->setPrefixPart(6, ""); 24} catch (OutOfRangeException $e) { 25 echo "OutOfRangeException thrown\n"; 26} 27try { 28 $it->setPrefixPart(6, ""); 29} catch (OutOfRangeException $e) { 30 echo "OutOfRangeException thrown\n"; 31} 32?> 33===DONE=== 34--EXPECT-- 35[a] => 035Array 36[0] => 0145b 37[c] => 045Array 38[0] => 0245d 39OutOfRangeException thrown 40OutOfRangeException thrown 41===DONE=== 42