diff --git a/ext/opcache/Optimizer/dce.c b/ext/opcache/Optimizer/dce.c index 2992bb60b37..ea81687bf43 100644 --- a/ext/opcache/Optimizer/dce.c +++ b/ext/opcache/Optimizer/dce.c @@ -124,6 +124,7 @@ static inline zend_bool may_have_side_effects( case ZEND_IN_ARRAY: case ZEND_FUNC_NUM_ARGS: case ZEND_FUNC_GET_ARGS: + case ZEND_ARRAY_KEY_EXISTS: /* No side effects */ return 0; case ZEND_ROPE_END: diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 975853a9eb5..1838fe387ba 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -4634,6 +4634,14 @@ int zend_may_throw(const zend_op *opline, const zend_op_array *op_array, zend_ss default: return 1; } + case ZEND_ARRAY_KEY_EXISTS: + if ((t2 & MAY_BE_ANY) != MAY_BE_ARRAY) { + return 1; + } + if ((t1 & (MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) { + return 1; + } + return 0; default: return 1; }