return SUCCESS;
}
+static inline int ct_eval_array_key_exists(zval *result, zval *op1, zval *op2) {
+ zval *value;
+
+ if (Z_TYPE_P(op2) != IS_ARRAY && !IS_PARTIAL_ARRAY(op2)) {
+ return FAILURE;
+ }
+ if (Z_TYPE_P(op1) != IS_STRING && Z_TYPE_P(op1) != IS_LONG && Z_TYPE_P(op1) != IS_NULL) {
+ return FAILURE;
+ }
+ if (fetch_array_elem(&value, op2, op1) == FAILURE) {
+ return FAILURE;
+ }
+ if (IS_PARTIAL_ARRAY(op2) && (!value || IS_BOT(value))) {
+ return FAILURE;
+ }
+
+ ZVAL_BOOL(result, value != NULL);
+ return SUCCESS;
+}
+
/* The functions chosen here are simple to implement and either likely to affect a branch,
* or just happened to be commonly used with constant operands in WP (need to test other
* applications as well, of course). */
}
SET_RESULT_BOT(result);
break;
+ case ZEND_ARRAY_KEY_EXISTS:
+ SKIP_IF_TOP(op1);
+ SKIP_IF_TOP(op2);
+ if (ct_eval_array_key_exists(&zv, op1, op2) == SUCCESS) {
+ SET_RESULT(result, &zv);
+ zval_ptr_dtor_nogc(&zv);
+ break;
+ }
+ SET_RESULT_BOT(result);
+ break;
case ZEND_FETCH_DIM_R:
case ZEND_FETCH_DIM_IS:
case ZEND_FETCH_LIST_R: