mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
commit
53fba3a13d
12
Zend/tests/write_property_ref_overwrite_return.phpt
Normal file
12
Zend/tests/write_property_ref_overwrite_return.phpt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
--TEST--
|
||||||
|
Using return of property assignment to reference that destroys object
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$a = new stdClass;
|
||||||
|
$a->a =& $a;
|
||||||
|
var_dump($a->a = 0);
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
int(0)
|
@ -738,7 +738,8 @@ ZEND_API zval *zend_std_write_property(zend_object *zobj, zend_string *name, zva
|
|||||||
}
|
}
|
||||||
|
|
||||||
found:
|
found:
|
||||||
zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR, property_uses_strict_types());
|
variable_ptr = zend_assign_to_variable(
|
||||||
|
variable_ptr, value, IS_TMP_VAR, property_uses_strict_types());
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
if (Z_PROP_FLAG_P(variable_ptr) == IS_PROP_UNINIT) {
|
if (Z_PROP_FLAG_P(variable_ptr) == IS_PROP_UNINIT) {
|
||||||
|
Loading…
Reference in New Issue
Block a user