@@ -6373,6 +6373,60 @@ ZEND_VM_C_LABEL(isset_no_object):
6373
6373
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION ();
6374
6374
}
6375
6375
6376
+ ZEND_VM_HANDLER (199 , ZEND_ARRAY_KEY_EXISTS , CV |TMPVAR |CONST , CV |TMPVAR |CONST )
6377
+ {
6378
+ USE_OPLINE
6379
+
6380
+ zend_free_op free_op1 , free_op2 ;
6381
+ zval * subject , * key ;
6382
+ int result ;
6383
+
6384
+ SAVE_OPLINE ();
6385
+
6386
+ subject = GET_OP2_ZVAL_PTR (BP_VAR_R );
6387
+ key = GET_OP1_ZVAL_PTR (BP_VAR_R );
6388
+
6389
+ if (UNEXPECTED (Z_ISREF_P (subject ))) {
6390
+ subject = Z_REFVAL_P (subject );
6391
+ }
6392
+ if (UNEXPECTED (Z_ISREF_P (key ))) {
6393
+ key = Z_REFVAL_P (key );
6394
+ }
6395
+
6396
+ if (EXPECTED (Z_TYPE_P (subject ) == IS_ARRAY )) {
6397
+ if (EXPECTED (Z_TYPE_P (key ) == IS_STRING )) {
6398
+ result = zend_symtable_exists_ind (Z_ARRVAL_P (subject ), Z_STR_P (key ));
6399
+ } else if (EXPECTED (Z_TYPE_P (key ) == IS_LONG )) {
6400
+ result = zend_hash_index_exists (Z_ARRVAL_P (subject ), Z_LVAL_P (key ));
6401
+ } else if (UNEXPECTED (Z_TYPE_P (key ) == IS_NULL )) {
6402
+ result = zend_symtable_exists_ind (Z_ARRVAL_P (subject ), ZSTR_EMPTY_ALLOC ());
6403
+ } else {
6404
+ zend_error (E_WARNING , "array_key_exists(): The first argument should be either a string or an integer" );
6405
+ result = 0 ;
6406
+ }
6407
+ ZVAL_BOOL (EX_VAR (opline -> result .var ), result );
6408
+ } else if (UNEXPECTED (Z_TYPE_P (subject ) == IS_OBJECT )) {
6409
+ if (EXPECTED (Z_TYPE_P (key ) == IS_STRING )) {
6410
+ result = zend_symtable_exists_ind (Z_OBJPROP_P (subject ), Z_STR_P (key ));
6411
+ } else if (EXPECTED (Z_TYPE_P (key ) == IS_LONG )) {
6412
+ result = zend_hash_index_exists (Z_OBJPROP_P (subject ), Z_LVAL_P (key ));
6413
+ } else if (UNEXPECTED (Z_TYPE_P (key ) == IS_NULL )) {
6414
+ result = zend_symtable_exists_ind (Z_OBJPROP_P (subject ), ZSTR_EMPTY_ALLOC ());
6415
+ } else {
6416
+ zend_error (E_WARNING , "array_key_exists(): The first argument should be either a string or an integer" );
6417
+ result = 0 ;
6418
+ }
6419
+ ZVAL_BOOL (EX_VAR (opline -> result .var ), result );
6420
+ } else {
6421
+ zend_internal_type_error (EX_USES_STRICT_TYPES (), "array_key_exists() expects parameter 2 to be array, %s given" , zend_get_type_by_const (Z_TYPE_P (subject )));
6422
+ ZVAL_NULL (EX_VAR (opline -> result .var ));
6423
+ }
6424
+
6425
+ FREE_OP2 ();
6426
+ FREE_OP1 ();
6427
+ ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION ();
6428
+ }
6429
+
6376
6430
ZEND_VM_COLD_HANDLER (79 , ZEND_EXIT , CONST |TMPVAR |UNUSED |CV , ANY )
6377
6431
{
6378
6432
USE_OPLINE
0 commit comments