xref: /PHP-5.4/ext/spl/tests/iterator_048.phpt (revision 610c7fbe)
1--TEST--
2SPL: RecursiveRegexIterator and exception in has/getChildren
3--FILE--
4<?php
5
6class 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--
32int(0)
33string(3) "Bar"
34int(2)
35string(6) "FooBar"
36===DONE===
37