]> granicus.if.org Git - php/commitdiff
Fix bug #67922
authorNikita Popov <nikic@php.net>
Thu, 28 Aug 2014 22:18:38 +0000 (00:18 +0200)
committerNikita Popov <nikic@php.net>
Thu, 28 Aug 2014 22:18:38 +0000 (00:18 +0200)
Zend/tests/bug67922.phpt [new file with mode: 0644]
Zend/zend_compile.c

diff --git a/Zend/tests/bug67922.phpt b/Zend/tests/bug67922.phpt
new file mode 100644 (file)
index 0000000..8be3f2e
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Bug #67922: Member function not found when dereferencing in write-context
+--FILE--
+<?php
+
+class C {
+       public function test() {
+               return new stdClass;
+       }
+}
+
+$b = new stdClass;
+$b->c = new C;
+$b->c->test()->d = 'str';
+
+?>
+===DONE===
+--EXPECT--
+===DONE===
index aa3ac722e1e7fc2329156eede5576cb44c26a13c..ed95d7eb62e639caddb3f7dca7d2a0e028a78888 100644 (file)
@@ -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);