Make the check less conservative to be consistent with the other
cases.
&& (opline->op2_type != IS_CV || opline->op2.var != cv_var);
}
- if (opline->opcode == ZEND_CAST) {
+ if (opline->opcode == ZEND_CAST
+ && (opline->extended_value == IS_ARRAY || opline->extended_value == IS_OBJECT)) {
/* CAST to array/object may initialize the result to an empty array/object before
* reading the expression. */
- return opline->extended_value != IS_ARRAY && opline->extended_value != IS_OBJECT;
+ return opline->op1_type != IS_CV || opline->op1.var != cv_var;
}
return 1;