1--TEST-- 2SPL: CachingIterator::hasNext() 3--FILE-- 4<?php 5 6$ar = array(1, 2, array(31, 32, array(331)), 4); 7 8$it = new RecursiveArrayIterator($ar); 9$it = new RecursiveCachingIterator($it); 10$it = new RecursiveIteratorIterator($it); 11 12foreach($it as $k=>$v) 13{ 14 echo "$k=>$v\n"; 15 echo "hasNext: " . ($it->getInnerIterator()->hasNext() ? "yes" : "no") . "\n"; 16} 17 18?> 19===DONE=== 20<?php exit(0); ?> 21--EXPECTF-- 220=>1 23hasNext: yes 241=>2 25hasNext: yes 260=>31 27hasNext: yes 281=>32 29hasNext: yes 300=>331 31hasNext: no 323=>4 33hasNext: no 34===DONE=== 35