Annotation of embedaddon/php/ext/spl/tests/iterator_026.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: 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:
! 12: foreach($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--
! 22: 0=>1
! 23: hasNext: yes
! 24: 1=>2
! 25: hasNext: yes
! 26: 0=>31
! 27: hasNext: yes
! 28: 1=>32
! 29: hasNext: yes
! 30: 0=>331
! 31: hasNext: no
! 32: 3=>4
! 33: hasNext: no
! 34: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>