diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-12-20 10:33:18 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-12-20 10:35:34 +0100 |
commit | 885b3451f4e9616e3d7d8e31cc2270f1b07ab139 (patch) | |
tree | 94fcb8be2f08255bd7ea8c7bdb1be09b9acb8f70 /Zend/tests/overloaded_assign_prop_return_value.phpt | |
parent | 66d5b0608a40cd21bc20529e82b62c308178530a (diff) | |
download | php-git-885b3451f4e9616e3d7d8e31cc2270f1b07ab139.tar.gz |
Fix early free of assign_obj op_data
We need to make sure that op_data is only freed after populating
result, as op_data may be the only thing holding the value in the
case of an overloaded assignment.
This reverts the code to how it looked like in 7.3.
Diffstat (limited to 'Zend/tests/overloaded_assign_prop_return_value.phpt')
-rw-r--r-- | Zend/tests/overloaded_assign_prop_return_value.phpt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Zend/tests/overloaded_assign_prop_return_value.phpt b/Zend/tests/overloaded_assign_prop_return_value.phpt new file mode 100644 index 0000000000..954505f1e9 --- /dev/null +++ b/Zend/tests/overloaded_assign_prop_return_value.phpt @@ -0,0 +1,14 @@ +--TEST-- +Make sure the return value of a property assignment is not freed to early +--FILE-- +<?php +class Overloaded { + function __set($r, $a) {} +} +$obj = new Overloaded; +$x = $obj->prop = new stdClass; +var_dump($x); +?> +--EXPECT-- +object(stdClass)#2 (0) { +} |