mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
e63febb1c7
Ensure that the "creating default object from empty value" warning is always thrown. Previously some cases were missing the warning, in particular those going through FETCH_OBJ_W rather than a dedicated opcode (like ASSIGN_OBJ). One slightly unfortunate side-effect of this change is that something like $a->b->c = 'd' will now generate two warnings rather than one when $a is null (one for property b, one for property c).
21 lines
365 B
PHP
21 lines
365 B
PHP
--TEST--
|
|
Bug #71539.5 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)
|
|
--FILE--
|
|
<?php
|
|
$array = [];
|
|
$array['']->prop =& $array[0];
|
|
$array[0] = 42;
|
|
var_dump($array);
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Creating default object from empty value in %sbug71539_5.php on line 3
|
|
array(2) {
|
|
[0]=>
|
|
&int(42)
|
|
[""]=>
|
|
object(stdClass)#1 (1) {
|
|
["prop"]=>
|
|
&int(42)
|
|
}
|
|
}
|