diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-18 14:52:22 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-18 14:54:43 +0100 |
commit | df79277de35e096c654cf49b5e20960b3b8236c4 (patch) | |
tree | de58509991bd13f05148075d8b18794a680ff658 /Zend/zend_compile.c | |
parent | a5f136b8556cdd6ff3b96f976d0f3b6a25052171 (diff) | |
download | php-git-df79277de35e096c654cf49b5e20960b3b8236c4.tar.gz |
Revert "Fetch for read in nested property assignments"
This reverts commit bb43a3822e42dbd15b1d416a166549d3980b379a.
After thinking about this a bit more, this is now going to be
a complete solution for the "readonly properties" case, for example:
unset($foo->readOnly->bar);
should also be legal and
$foo->readOnly['bar'] = 42;
should also be legal if $foo->readOnly is not an array but an
ArrayAccess object.
I think it may be better to distinguish better on the BP_VAR flag
level. Reverting for now.
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r-- | Zend/zend_compile.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 9fa1f20f2d..2050e3ba71 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2703,13 +2703,7 @@ static zend_op *zend_delayed_compile_prop(znode *result, zend_ast *ast, uint32_t } CG(active_op_array)->fn_flags |= ZEND_ACC_USES_THIS; } else { - /* In $a->b->c = $d, fetch $a->b for read and only ->c for write. - * We will never modify $a->b itself, only the object it holds. */ - if (type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_FUNC_ARG) { - opline = zend_delayed_compile_var(&obj_node, obj_ast, BP_VAR_R, 0); - } else { - opline = zend_delayed_compile_var(&obj_node, obj_ast, type, 0); - } + opline = zend_delayed_compile_var(&obj_node, obj_ast, type, 0); zend_separate_if_call_and_write(&obj_node, obj_ast, type); } zend_compile_expr(&prop_node, prop_ast); |