Skip to content

Commit 53fba3a

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fixed bug #80173
2 parents 4743c7a + 4e66e6a commit 53fba3a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
Using return of property assignment to reference that destroys object
3+
--FILE--
4+
<?php
5+
6+
$a = new stdClass;
7+
$a->a =& $a;
8+
var_dump($a->a = 0);
9+
10+
?>
11+
--EXPECT--
12+
int(0)

Zend/zend_object_handlers.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,8 @@ ZEND_API zval *zend_std_write_property(zend_object *zobj, zend_string *name, zva
738738
}
739739

740740
found:
741-
zend_assign_to_variable(variable_ptr, value, IS_TMP_VAR, property_uses_strict_types());
741+
variable_ptr = zend_assign_to_variable(
742+
variable_ptr, value, IS_TMP_VAR, property_uses_strict_types());
742743
goto exit;
743744
}
744745
if (Z_PROP_FLAG_P(variable_ptr) == IS_PROP_UNINIT) {

0 commit comments

Comments
 (0)