Annotation of embedaddon/php/ext/spl/tests/iterator_011.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: InfiniteIterator
! 3: --FILE--
! 4: <?php
! 5:
! 6: echo "===EmptyIterator===\n";
! 7:
! 8: foreach(new LimitIterator(new InfiniteIterator(new EmptyIterator()), 0, 3) as $key=>$val)
! 9: {
! 10: echo "$key=>$val\n";
! 11: }
! 12:
! 13: echo "===InfiniteIterator===\n";
! 14:
! 15: $it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D'));
! 16: $it = new InfiniteIterator($it);
! 17: $it = new LimitIterator($it, 2, 5);
! 18: foreach($it as $val=>$key)
! 19: {
! 20: echo "$val=>$key\n";
! 21: }
! 22:
! 23: echo "===Infinite/LimitIterator===\n";
! 24:
! 25: $it = new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D'));
! 26: $it = new LimitIterator($it, 1, 2);
! 27: $it = new InfiniteIterator($it);
! 28: $it = new LimitIterator($it, 2, 5);
! 29: foreach($it as $val=>$key)
! 30: {
! 31: echo "$val=>$key\n";
! 32: }
! 33:
! 34: ?>
! 35: ===DONE===
! 36: <?php exit(0); ?>
! 37: --EXPECTF--
! 38: ===EmptyIterator===
! 39: ===InfiniteIterator===
! 40: 2=>C
! 41: 3=>D
! 42: 0=>A
! 43: 1=>B
! 44: 2=>C
! 45: ===Infinite/LimitIterator===
! 46: 1=>B
! 47: 2=>C
! 48: 1=>B
! 49: 2=>C
! 50: 1=>B
! 51: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>