mirror of
https://github.com/php/php-src.git
synced 2024-10-20 16:02:44 +00:00
28 lines
533 B
Plaintext
28 lines
533 B
Plaintext
|
--TEST--
|
||
|
Bug #31926 (php in free() error with RecursiveArrayIterator)
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
$array = array(0 => array('world'));
|
||
|
|
||
|
class RecursiveArrayIterator extends ArrayIterator implements
|
||
|
RecursiveIterator {
|
||
|
function hasChildren() {
|
||
|
return (is_array($this->current()));
|
||
|
}
|
||
|
|
||
|
function getChildren() {
|
||
|
return new self($this->current());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));
|
||
|
foreach($it as $key => $val) {
|
||
|
var_dump($key, $val);
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
int(0)
|
||
|
string(5) "world"
|