xref: /PHP-7.3/ext/spl/tests/iterator_048.phpt (revision ded3d984)
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
18$ar = new RecursiveArrayIterator(array('Foo', array('Bar'), 'FooBar', array('Baz'), 'Biz'));
19$it = new MyRecursiveRegexIterator($ar, '/Bar/');
20
21$it->show();
22
23?>
24===DONE===
25<?php exit(0); ?>
26--EXPECT--
27int(0)
28string(3) "Bar"
29int(2)
30string(6) "FooBar"
31===DONE===
32