mirror of
https://github.com/php/php-src.git
synced 2024-12-15 12:54:57 +08:00
36f5d719f5
In this case we ended up creating an ASSIGN_OBJ_REF with VAR result operand, which was not freed. Fix this by implementing assign_ref_znode the same was as assign_znode, i.e. performing an assignment with result and then freeing the result, which will result mark the result as UNUSED. This is more robust than the special handling for result == NULL that was used before. This fixes one of the issues reported in bug #81190.
12 lines
163 B
PHP
12 lines
163 B
PHP
--TEST--
|
|
Foreach by ref assignment to property
|
|
--FILE--
|
|
<?php
|
|
$obj = new stdClass;
|
|
foreach ([0] as &$obj->prop) {
|
|
var_dump($obj->prop);
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
int(0)
|