diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 1838fe387bae..93e91a3872b4 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -3285,7 +3285,7 @@ static int zend_update_type_info(const zend_op_array *op_array, break; case ZEND_FE_FETCH_R: case ZEND_FE_FETCH_RW: - tmp = t2; + tmp = t2 & MAY_BE_REF; if (t1 & MAY_BE_OBJECT) { if (opline->opcode == ZEND_FE_FETCH_RW) { tmp |= MAY_BE_REF | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;