Annotation of embedaddon/php/ext/spl/tests/iterator_040.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: RecursiveFilterIterator
! 3: --FILE--
! 4: <?php
! 5:
! 6: class MyRecursiveFilterIterator extends RecursiveFilterIterator
! 7: {
! 8: function accept()
! 9: {
! 10: return true;
! 11: }
! 12: }
! 13:
! 14: $ar = array(1, array(21, 22), 3);
! 15: $it = new RecursiveArrayIterator($ar);
! 16: $it = new MyRecursiveFilterIterator($it);
! 17: $it = new RecursiveIteratorIterator($it);
! 18:
! 19: foreach($it as $k => $v)
! 20: {
! 21: echo "===\n";
! 22: var_dump($it->getDepth());
! 23: var_dump($k);
! 24: var_dump($v);
! 25: }
! 26:
! 27: ?>
! 28: ===DONE===
! 29: <?php exit(0); ?>
! 30: --EXPECT--
! 31: ===
! 32: int(0)
! 33: int(0)
! 34: int(1)
! 35: ===
! 36: int(1)
! 37: int(0)
! 38: int(21)
! 39: ===
! 40: int(1)
! 41: int(1)
! 42: int(22)
! 43: ===
! 44: int(0)
! 45: int(2)
! 46: int(3)
! 47: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>