From: Nikita Popov Date: Mon, 29 Jun 2020 07:52:37 +0000 (+0200) Subject: Don't inline static call to instance method X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fabcd9f14e52567fa41df189298c388336277b54;p=php Don't inline static call to instance method Fixes the failure in bug79740.phpt with opcache. --- diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c index ae707a2409..6af7865e92 100644 --- a/ext/opcache/Optimizer/optimize_func_calls.c +++ b/ext/opcache/Optimizer/optimize_func_calls.c @@ -106,6 +106,12 @@ static void zend_try_inline_call(zend_op_array *op_array, zend_op *fcall, zend_o uint32_t i, num_args = func->op_array.num_args; num_args += (func->op_array.fn_flags & ZEND_ACC_VARIADIC) != 0; + if (fcall->opcode == ZEND_INIT_STATIC_METHOD_CALL + && !(func->op_array.fn_flags & ZEND_ACC_STATIC)) { + /* Don't inline static call to instance method. */ + return; + } + 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 object context ???