diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 81a865049b8..835643a5e68 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2202,9 +2202,10 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type) /* see bug #15471 (old BTS) */ if (persistent_script->script.filename) { - if (!EG(current_execute_data) || !EG(current_execute_data)->opline || + if (!EG(current_execute_data) || !EG(current_execute_data)->func || !ZEND_USER_CODE(EG(current_execute_data)->func->common.type) || + !EG(current_execute_data)->opline || EG(current_execute_data)->opline->opcode != ZEND_INCLUDE_OR_EVAL || (EG(current_execute_data)->opline->extended_value != ZEND_INCLUDE_ONCE && EG(current_execute_data)->opline->extended_value != ZEND_REQUIRE_ONCE)) {