From: Nikita Popov Date: Thu, 28 Aug 2014 22:18:38 +0000 (+0200) Subject: Fix bug #67922 X-Git-Tag: PRE_PHP7_REMOVALS~209 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae7e663330b241bf7906551f9e801223aa067dbf;p=php Fix bug #67922 --- diff --git a/Zend/tests/bug67922.phpt b/Zend/tests/bug67922.phpt new file mode 100644 index 0000000000..8be3f2eba0 --- /dev/null +++ b/Zend/tests/bug67922.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #67922: Member function not found when dereferencing in write-context +--FILE-- +c = new C; +$b->c->test()->d = 'str'; + +?> +===DONE=== +--EXPECT-- +===DONE=== diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index aa3ac722e1..ed95d7eb62 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -4369,7 +4369,7 @@ void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type TSRMLS if (is_this_fetch(obj_ast)) { obj_node.op_type = IS_UNUSED; } else { - zend_compile_var(&obj_node, obj_ast, type TSRMLS_CC); + zend_compile_expr(&obj_node, obj_ast TSRMLS_CC); } zend_compile_expr(&method_node, method_ast TSRMLS_CC);