Fixed bug #23104 (hash position of static arrays not being reset)

This commit is contained in:
Ilia Alshanetsky 2003-08-04 17:10:52 +00:00
parent 1345027597
commit 1007b0a826
2 changed files with 13 additions and 0 deletions

12
Zend/tests/bug23104.phpt Normal file
View File

@ -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"

View 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;
}