This commit is contained in:
Nikita Popov 2014-08-29 00:18:38 +02:00
parent 389d285973
commit ae7e663330
2 changed files with 20 additions and 1 deletions

19
Zend/tests/bug67922.phpt Normal file
View File

@ -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===

View 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);