From: SVN Migration Date: Sat, 12 Feb 2005 18:40:20 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. X-Git-Tag: php-5.0.4RC1~172 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e680913da746da2da7f6e841713dbbb4395aaa4;p=php This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. --- diff --git a/ext/spl/tests/bug31926.phpt b/ext/spl/tests/bug31926.phpt new file mode 100755 index 0000000000..428039b1cb --- /dev/null +++ b/ext/spl/tests/bug31926.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #31926 (php in free() error with RecursiveArrayIterator) +--FILE-- + 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"