From 3a452426693aed93d5392cb68aff7eacd73989e3 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 30 Jun 2016 21:05:48 +0300 Subject: [PATCH] Disable inlining for $this->foo(), because $this may be not in object context --- ext/opcache/Optimizer/optimize_func_calls.c | 2 +- ext/opcache/tests/wrong_inlining_002.phpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c index 0d5e4d7f3a..f4565b04a0 100644 --- a/ext/opcache/Optimizer/optimize_func_calls.c +++ b/ext/opcache/Optimizer/optimize_func_calls.c @@ -100,7 +100,7 @@ static void zend_try_inline_call(zend_op_array *op_array, zend_op *fcall, zend_o if (fcall->opcode == ZEND_INIT_METHOD_CALL && fcall->op1_type == IS_UNUSED) { /* TODO: we can't inlne methods, because $this may be used - * not in class context ??? + * not in object context ??? */ return; } diff --git a/ext/opcache/tests/wrong_inlining_002.phpt b/ext/opcache/tests/wrong_inlining_002.phpt index e132f987e3..4e71a96d10 100644 --- a/ext/opcache/tests/wrong_inlining_002.phpt +++ b/ext/opcache/tests/wrong_inlining_002.phpt @@ -1,5 +1,5 @@ --TEST-- -Pass result of inlined function by reference +$this not in object context --INI-- opcache.enable=1 opcache.enable_cli=1 -- 2.40.0