mirror of
https://github.com/php/php-src.git
synced 2024-12-14 20:33:36 +08:00
61d00a6cf3
This fixes the behavior when the storage location of the fetch is modified before the operand is dereferenced by the using VM opcode. Furthermore it elimiates references as a possible return value from *_R opcodes, which will give us more opportunities for inferences, in particular in regard to typed properties.
18 lines
280 B
PHP
18 lines
280 B
PHP
--TEST--
|
|
Bug #72543.5 (different references behavior comparing to PHP 5)
|
|
--FILE--
|
|
<?php
|
|
$arr = [1];
|
|
$ref =& $arr[0];
|
|
var_dump($arr[0] + ($arr[0] = 2));
|
|
|
|
$obj = new stdClass;
|
|
$obj->prop = 1;
|
|
$ref =& $obj->prop;
|
|
var_dump($obj->prop + ($obj->prop = 2));
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(3)
|
|
int(3)
|