Skip to content

Commit 3a45242

Browse files
committed
Disable inlining for $this->foo(), because $this may be not in object context
1 parent c3667a5 commit 3a45242

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/opcache/Optimizer/optimize_func_calls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static void zend_try_inline_call(zend_op_array *op_array, zend_op *fcall, zend_o
100100

101101
if (fcall->opcode == ZEND_INIT_METHOD_CALL && fcall->op1_type == IS_UNUSED) {
102102
/* TODO: we can't inlne methods, because $this may be used
103-
* not in class context ???
103+
* not in object context ???
104104
*/
105105
return;
106106
}

ext/opcache/tests/wrong_inlining_002.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
Pass result of inlined function by reference
2+
$this not in object context
33
--INI--
44
opcache.enable=1
55
opcache.enable_cli=1

0 commit comments

Comments
 (0)