summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-08-04 17:10:52 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-08-04 17:10:52 +0000
commit1007b0a826e6d9cc8d048c95e15ad493ce22d899 (patch)
treeb80c33b4103a126ffa817547ac9c9ce26d2996f9
parent13450275974ba9d92a5dec0a66b95f5e21101a0e (diff)
downloadphp-git-1007b0a826e6d9cc8d048c95e15ad493ce22d899.tar.gz
Fixed bug #23104 (hash position of static arrays not being reset)
-rw-r--r--Zend/tests/bug23104.phpt12
-rw-r--r--Zend/zend_execute_API.c1
2 files changed, 13 insertions, 0 deletions
diff --git a/Zend/tests/bug23104.phpt b/Zend/tests/bug23104.phpt
new file mode 100644
index 0000000000..04df3bdeb5
--- /dev/null
+++ b/Zend/tests/bug23104.phpt
@@ -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"
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 109cf5e305..f55094e066 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -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;
}