diff options
| author | Xinchen Hui <laruence@gmail.com> | 2016-08-26 18:32:54 +0800 |
|---|---|---|
| committer | Xinchen Hui <laruence@gmail.com> | 2016-08-26 18:32:54 +0800 |
| commit | 557f1ccf0cc185d712597e11ecedff3171a69110 (patch) | |
| tree | 6c361c8212070a51de2d8618cd8371d4de382adb | |
| parent | 726e3b8ff0195bfa97b072cb6f986948cd49d8a9 (diff) | |
| parent | c67fa3c91d314fd932fa1c921497fe3e6a968785 (diff) | |
| download | php-git-557f1ccf0cc185d712597e11ecedff3171a69110.tar.gz | |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
Fixed bug #72943 (assign_dim on string doesn't reset hval)
Conflicts:
Zend/zend_execute.c
| -rw-r--r-- | NEWS | 1 | ||||
| -rw-r--r-- | Zend/tests/bug72943.phpt | 20 | ||||
| -rw-r--r-- | Zend/zend_execute.c | 1 |
3 files changed, 22 insertions, 0 deletions
@@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2016, PHP 7.1.0RC1 - Core: + . Fixed bug #72943 (assign_dim on string doesn't reset hval). (Laruence) . Fixed bug #72598 (Reference is lost after array_slice()) (Nikita) - COM: diff --git a/Zend/tests/bug72943.phpt b/Zend/tests/bug72943.phpt new file mode 100644 index 0000000000..8bab6de456 --- /dev/null +++ b/Zend/tests/bug72943.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #72943 (assign_dim on string doesn't reset hval) +--FILE-- +<?php +$array = array("test" => 1); + +$a = "lest"; +var_dump($array[$a]); +$a[0] = "f"; +var_dump($array[$a]); +$a[0] = "t"; +var_dump($array[$a]); +?> +--EXPECTF-- +Notice: Undefined index: lest in %sbug72943.php on line %d +NULL + +Notice: Undefined index: fest in %sbug72943.php on line %d +NULL +int(1) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index d2411ad5c3..f0f249e243 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1330,6 +1330,7 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim, zend_string_release(old_str); } else { SEPARATE_STRING(str); + zend_string_forget_hash_val(Z_STR_P(str)); } Z_STRVAL_P(str)[offset] = c; |
