From: Dmitry Stogov Date: Thu, 30 Jun 2016 18:05:48 +0000 (+0300) Subject: Disable inlining for $this->foo(), because $this may be not in object context X-Git-Tag: php-7.1.0alpha3~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a452426693aed93d5392cb68aff7eacd73989e3;p=php Disable inlining for $this->foo(), because $this may be not in object context --- 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