mirror of
https://github.com/php/php-src.git
synced 2025-01-09 12:34:14 +08:00
Add DCE support for ARRAY_KEY_EXISTS
This commit is contained in:
parent
1c4ad17cc1
commit
9e403d65d8
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user