mirror of
https://github.com/php/php-src.git
synced 2024-09-28 21:36:12 +00:00
c2fe893985
not called. #Merge to 5.3 pending (slight BC break on AppendIterator, as it's no #longer possible to defer the call to the parent constructor until #after the constructor is performed). #Bugs fixed in an atypical way for SPL. The parent constructor call #check is performed at construction time by using a wrapper constructor #instead of a check on the beginning of each instance method. #Perhaps this should be uniformized in trunk; this method was mainly #applied only to the ones crashing, except a few iterators (at least #AppendIterator and RecursiveIteratorIterator).
20 lines
676 B
PHP
20 lines
676 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 exception 'LogicException' with message 'In the constructor of RecursiveArrayIteratorIterator, parent::__construct() must be called and its exceptions cannot be cleared' in %s:%d
|
|
Stack trace:
|
|
#0 %s(%d): RecursiveArrayIteratorIterator->internal_construction_wrapper(Object(RecursiveArrayIterator), 2)
|
|
#1 {main}
|
|
thrown in %s on line %d
|