Skip to content

Commit bc62acf

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Don't inline static call to instance method
2 parents 562ceae + fabcd9f commit bc62acf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/opcache/Optimizer/optimize_func_calls.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ static void zend_try_inline_call(zend_op_array *op_array, zend_op *fcall, zend_o
107107
uint32_t i, num_args = func->op_array.num_args;
108108
num_args += (func->op_array.fn_flags & ZEND_ACC_VARIADIC) != 0;
109109

110+
if (fcall->opcode == ZEND_INIT_STATIC_METHOD_CALL
111+
&& !(func->op_array.fn_flags & ZEND_ACC_STATIC)) {
112+
/* Don't inline static call to instance method. */
113+
return;
114+
}
115+
110116
if (fcall->opcode == ZEND_INIT_METHOD_CALL && fcall->op1_type == IS_UNUSED) {
111117
/* TODO: we can't inlne methods, because $this may be used
112118
* not in object context ???

0 commit comments

Comments
 (0)