mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Same as with the IteratorAggregate case, allow reusing get_iterator if none of the Iterator methods are overridden. Drop the REUSE_GET_ITERATOR flag that previously allowed ArrayIterator to opt-in to unconditional get_iterator reuse, and drop the override handling it did, in favor of the automated approach.
19 lines
447 B
PHP
19 lines
447 B
PHP
--TEST--
|
|
Bug #54281 (Crash in spl_recursive_it_rewind_ex)
|
|
--FILE--
|
|
<?php
|
|
|
|
class RecursiveArrayIteratorIterator extends RecursiveIteratorIterator {
|
|
function __construct($it, $max_depth) { }
|
|
}
|
|
$it = new RecursiveArrayIteratorIterator(new RecursiveArrayIterator(array()), 2);
|
|
|
|
foreach($it as $k=>$v) { }
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: Object is not initialized in %s:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %s%ebug54281.php on line 8
|