]> granicus.if.org Git - php/commitdiff
- Add new test
authorMarcus Boerger <helly@php.net>
Sat, 12 Feb 2005 18:40:19 +0000 (18:40 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 12 Feb 2005 18:40:19 +0000 (18:40 +0000)
ext/spl/tests/bug31926.phpt [new file with mode: 0755]

diff --git a/ext/spl/tests/bug31926.phpt b/ext/spl/tests/bug31926.phpt
new file mode 100755 (executable)
index 0000000..428039b
--- /dev/null
@@ -0,0 +1,27 @@
+--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"