xref: /PHP-8.1/ext/spl/tests/iterator_048.phpt (revision f8d79582)
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--EXPECT--
25int(0)
26string(3) "Bar"
27int(2)
28string(6) "FooBar"
29