Skip to content

Commit ae7e663

Browse files
committed
Fix bug #67922
1 parent 389d285 commit ae7e663

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

Zend/tests/bug67922.phpt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
Bug #67922: Member function not found when dereferencing in write-context
3+
--FILE--
4+
<?php
5+
6+
class C {
7+
public function test() {
8+
return new stdClass;
9+
}
10+
}
11+
12+
$b = new stdClass;
13+
$b->c = new C;
14+
$b->c->test()->d = 'str';
15+
16+
?>
17+
===DONE===
18+
--EXPECT--
19+
===DONE===

Zend/zend_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4369,7 +4369,7 @@ void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type TSRMLS
43694369
if (is_this_fetch(obj_ast)) {
43704370
obj_node.op_type = IS_UNUSED;
43714371
} else {
4372-
zend_compile_var(&obj_node, obj_ast, type TSRMLS_CC);
4372+
zend_compile_expr(&obj_node, obj_ast TSRMLS_CC);
43734373
}
43744374

43754375
zend_compile_expr(&method_node, method_ast TSRMLS_CC);

0 commit comments

Comments
 (0)