mirror of
https://github.com/php/php-src.git
synced 2026-04-01 05:02:27 +02:00
Merge branch 'PHP-7.1'
* PHP-7.1: Fixed bug #72943 (assign_dim on string doesn't reset hval)
This commit is contained in:
20
Zend/tests/bug72943.phpt
Normal file
20
Zend/tests/bug72943.phpt
Normal file
@@ -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)
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user