diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2003-08-04 17:10:52 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2003-08-04 17:10:52 +0000 |
| commit | 1007b0a826e6d9cc8d048c95e15ad493ce22d899 (patch) | |
| tree | b80c33b4103a126ffa817547ac9c9ce26d2996f9 | |
| parent | 13450275974ba9d92a5dec0a66b95f5e21101a0e (diff) | |
| download | php-git-1007b0a826e6d9cc8d048c95e15ad493ce22d899.tar.gz | |
Fixed bug #23104 (hash position of static arrays not being reset)
| -rw-r--r-- | Zend/tests/bug23104.phpt | 12 | ||||
| -rw-r--r-- | Zend/zend_execute_API.c | 1 |
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; } |
