Annotation of embedaddon/php/ext/spl/tests/iterator_048.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SPL: RecursiveRegexIterator and exception in has/getChildren
! 3: --FILE--
! 4: <?php
! 5:
! 6: class MyRecursiveRegexIterator extends RecursiveRegexIterator
! 7: {
! 8: function show()
! 9: {
! 10: foreach(new RecursiveIteratorIterator($this) as $k => $v)
! 11: {
! 12: var_dump($k);
! 13: var_dump($v);
! 14: }
! 15: }
! 16:
! 17: function accept()
! 18: {
! 19: return $this->hasChildren() || parent::accept();
! 20: }
! 21: }
! 22:
! 23: $ar = new RecursiveArrayIterator(array('Foo', array('Bar'), 'FooBar', array('Baz'), 'Biz'));
! 24: $it = new MyRecursiveRegexIterator($ar, '/Bar/');
! 25:
! 26: $it->show();
! 27:
! 28: ?>
! 29: ===DONE===
! 30: <?php exit(0); ?>
! 31: --EXPECTF--
! 32: int(0)
! 33: string(3) "Bar"
! 34: int(2)
! 35: string(6) "FooBar"
! 36: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>