xref: /PHP-8.0/ext/spl/tests/bug54281.phpt (revision b6207338)
1--TEST--
2Bug #54281 (Crash in spl_recursive_it_rewind_ex)
3--FILE--
4<?php
5
6class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator {
7    function __construct($it, $max_depth) { }
8}
9$it = new RecursiveArrayIteratorIterator(new RecursiveArrayIterator(array()), 2);
10
11foreach($it as $k=>$v) { }
12
13?>
14--EXPECTF--
15Fatal error: Uncaught Error: The object is in an invalid state as the parent constructor was not called in %s:%d
16Stack trace:
17#0 %s%ebug54281.php(8): RecursiveIteratorIterator->rewind()
18#1 {main}
19  thrown in %s%ebug54281.php on line 8
20