Skip to content

Commit f7c44ef

Browse files
TysonAndredstogov
authored andcommitted
Make opcache infer array_key_exists is non-null bool
array_key_exists now throws a TypeError instead of returning null for invalid arguments after 14bdb0c
1 parent e2a8cc0 commit f7c44ef

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

ext/opcache/Optimizer/zend_inference.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,14 +2480,8 @@ static int zend_update_type_info(const zend_op_array *op_array,
24802480
case ZEND_ISSET_ISEMPTY_STATIC_PROP:
24812481
case ZEND_ASSERT_CHECK:
24822482
case ZEND_IN_ARRAY:
2483-
UPDATE_SSA_TYPE(MAY_BE_FALSE|MAY_BE_TRUE, ssa_ops[i].result_def);
2484-
break;
24852483
case ZEND_ARRAY_KEY_EXISTS:
2486-
tmp = MAY_BE_FALSE|MAY_BE_TRUE;
2487-
if (t2 & ((MAY_BE_ANY|MAY_BE_UNDEF) - (MAY_BE_ARRAY|MAY_BE_OBJECT))) {
2488-
tmp |= MAY_BE_NULL;
2489-
}
2490-
UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def);
2484+
UPDATE_SSA_TYPE(MAY_BE_FALSE|MAY_BE_TRUE, ssa_ops[i].result_def);
24912485
break;
24922486
case ZEND_CAST:
24932487
if (ssa_ops[i].op1_def >= 0) {

0 commit comments

Comments
 (0)