From: Marcus Boerger Date: Sat, 12 Feb 2005 18:40:19 +0000 (+0000) Subject: - Add new test X-Git-Tag: RELEASE_0_2_3~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1a35bcfcbcce88ce63e31666b5b6a03ad915ae22;p=php - Add new test --- 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"