]> granicus.if.org Git - php/commitdiff
Fixed bug #23104 (hash position of static arrays not being reset)
authorIlia Alshanetsky <iliaa@php.net>
Mon, 4 Aug 2003 17:10:52 +0000 (17:10 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 4 Aug 2003 17:10:52 +0000 (17:10 +0000)
Zend/tests/bug23104.phpt [new file with mode: 0644]
Zend/zend_execute_API.c

diff --git a/Zend/tests/bug23104.phpt b/Zend/tests/bug23104.phpt
new file mode 100644 (file)
index 0000000..04df3bd
--- /dev/null
@@ -0,0 +1,12 @@
+--TEST--
+Bug #23104 (Hash position not reset for constant arrays)
+--FILE--
+<?php
+function foo($bar = array("a", "b", "c"))
+{
+       var_dump(current($bar));
+}
+foo();
+?>
+--EXPECT--
+string(1) "a"
index 109cf5e3050a69f946444b90f218685969ca9bc8..f55094e0665a4f3b3c4b7a5bda271715d4ff70ac 100644 (file)
@@ -457,6 +457,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
                        zval_dtor(&const_value);
                }
                zend_hash_apply_with_argument(p->value.ht, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
+               zend_hash_internal_pointer_reset(p->value.ht);
        }
        return 0;
 }