From 1a35bcfcbcce88ce63e31666b5b6a03ad915ae22 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sat, 12 Feb 2005 18:40:19 +0000 Subject: [PATCH] - Add new test --- ext/spl/tests/bug31926.phpt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 ext/spl/tests/bug31926.phpt 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" -- 2.50.1