@@ -500,33 +500,16 @@ static void ZEND_FASTCALL zend_jit_fetch_dim_r_helper(zend_array *ht, zval *dim,
500
500
}
501
501
ZEND_FALLTHROUGH ;
502
502
case IS_NULL :
503
- /* The array may be destroyed while throwing the notice.
504
- * Temporarily increase the refcount to detect this situation. */
505
- if (!(GC_FLAGS (ht ) & IS_ARRAY_IMMUTABLE )) {
506
- GC_ADDREF (ht );
503
+ retval = zend_hash_find (ht , ZSTR_EMPTY_ALLOC ());
504
+ if (!retval ) {
505
+ ZVAL_NULL (result );
506
+ } else {
507
+ ZVAL_COPY_DEREF (result , retval );
507
508
}
508
- execute_data = EG (current_execute_data );
509
- opline = EX (opline );
509
+
510
510
zend_error (E_DEPRECATED , "Using null as an array offset is deprecated, use an empty string instead" );
511
- if (!(GC_FLAGS (ht ) & IS_ARRAY_IMMUTABLE ) && !GC_DELREF (ht )) {
512
- zend_array_destroy (ht );
513
- if (opline -> result_type & (IS_VAR | IS_TMP_VAR )) {
514
- if (EG (exception )) {
515
- ZVAL_UNDEF (EX_VAR (opline -> result .var ));
516
- } else {
517
- ZVAL_NULL (EX_VAR (opline -> result .var ));
518
- }
519
- }
520
- return ;
521
- }
522
- if (EG (exception )) {
523
- if (opline -> result_type & (IS_VAR | IS_TMP_VAR )) {
524
- ZVAL_UNDEF (EX_VAR (opline -> result .var ));
525
- }
526
- return ;
527
- }
528
- offset_key = ZSTR_EMPTY_ALLOC ();
529
- goto str_index ;
511
+
512
+ return ;
530
513
case IS_DOUBLE :
531
514
hval = zend_dval_to_lval (Z_DVAL_P (dim ));
532
515
if (!zend_is_long_compatible (Z_DVAL_P (dim ), hval )) {
@@ -667,33 +650,16 @@ static void ZEND_FASTCALL zend_jit_fetch_dim_is_helper(zend_array *ht, zval *dim
667
650
}
668
651
ZEND_FALLTHROUGH ;
669
652
case IS_NULL :
670
- /* The array may be destroyed while throwing the notice.
671
- * Temporarily increase the refcount to detect this situation. */
672
- if (!(GC_FLAGS (ht ) & IS_ARRAY_IMMUTABLE )) {
673
- GC_ADDREF (ht );
653
+ retval = zend_hash_find (ht , ZSTR_EMPTY_ALLOC ());
654
+ if (!retval ) {
655
+ ZVAL_NULL (result );
656
+ } else {
657
+ ZVAL_COPY_DEREF (result , retval );
674
658
}
675
- execute_data = EG (current_execute_data );
676
- opline = EX (opline );
659
+
677
660
zend_error (E_DEPRECATED , "Using null as an array offset is deprecated, use an empty string instead" );
678
- if (!(GC_FLAGS (ht ) & IS_ARRAY_IMMUTABLE ) && !GC_DELREF (ht )) {
679
- zend_array_destroy (ht );
680
- if (opline -> result_type & (IS_VAR | IS_TMP_VAR )) {
681
- if (EG (exception )) {
682
- ZVAL_UNDEF (EX_VAR (opline -> result .var ));
683
- } else {
684
- ZVAL_NULL (EX_VAR (opline -> result .var ));
685
- }
686
- }
687
- return ;
688
- }
689
- if (EG (exception )) {
690
- if (opline -> result_type & (IS_VAR | IS_TMP_VAR )) {
691
- ZVAL_UNDEF (EX_VAR (opline -> result .var ));
692
- }
693
- return ;
694
- }
695
- offset_key = ZSTR_EMPTY_ALLOC ();
696
- goto str_index ;
661
+
662
+ return ;
697
663
case IS_DOUBLE :
698
664
hval = zend_dval_to_lval (Z_DVAL_P (dim ));
699
665
if (!zend_is_long_compatible (Z_DVAL_P (dim ), hval )) {
@@ -820,21 +786,15 @@ static int ZEND_FASTCALL zend_jit_fetch_dim_isset_helper(zend_array *ht, zval *d
820
786
}
821
787
ZEND_FALLTHROUGH ;
822
788
case IS_NULL :
823
- /* The array may be destroyed while throwing the notice.
824
- * Temporarily increase the refcount to detect this situation. */
825
- if (!(GC_FLAGS (ht ) & IS_ARRAY_IMMUTABLE )) {
826
- GC_ADDREF (ht );
827
- }
828
- zend_error (E_DEPRECATED , "Using null as an array offset is deprecated, use an empty string instead" );
829
- if (!(GC_FLAGS (ht ) & IS_ARRAY_IMMUTABLE ) && !GC_DELREF (ht )) {
830
- zend_array_destroy (ht );
831
- return 0 ;
832
- }
833
- if (EG (exception )) {
789
+ retval = zend_hash_find (ht , ZSTR_EMPTY_ALLOC ());
790
+ if (retval ) {
791
+ int result = Z_TYPE_P (retval ) > IS_NULL ;
792
+ zend_error (E_DEPRECATED , "Using null as an array offset is deprecated, use an empty string instead" );
793
+ return result ;
794
+ } else {
795
+ zend_error (E_DEPRECATED , "Using null as an array offset is deprecated, use an empty string instead" );
834
796
return 0 ;
835
797
}
836
- offset_key = ZSTR_EMPTY_ALLOC ();
837
- goto str_index ;
838
798
case IS_DOUBLE :
839
799
hval = zend_dval_to_lval (Z_DVAL_P (dim ));
840
800
if (!zend_is_long_compatible (Z_DVAL_P (dim ), hval )) {
@@ -943,13 +903,11 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_rw_helper(zend_array *ht, zval *di
943
903
case IS_NULL :
944
904
/* The array may be destroyed while throwing the notice.
945
905
* Temporarily increase the refcount to detect this situation. */
946
- if (!(GC_FLAGS (ht ) & IS_ARRAY_IMMUTABLE )) {
947
- GC_ADDREF (ht );
948
- }
906
+ GC_TRY_ADDREF (ht );
949
907
execute_data = EG (current_execute_data );
950
908
opline = EX (opline );
951
909
zend_error (E_DEPRECATED , "Using null as an array offset is deprecated, use an empty string instead" );
952
- if (!( GC_FLAGS ( ht ) & IS_ARRAY_IMMUTABLE ) && GC_DELREF (ht ) != 1 ) {
910
+ if (GC_DELREF (ht ) != 1 ) {
953
911
if (!GC_REFCOUNT (ht )) {
954
912
zend_array_destroy (ht );
955
913
}
@@ -1103,13 +1061,11 @@ static zval* ZEND_FASTCALL zend_jit_fetch_dim_w_helper(zend_array *ht, zval *dim
1103
1061
case IS_NULL :
1104
1062
/* The array may be destroyed while throwing the notice.
1105
1063
* Temporarily increase the refcount to detect this situation. */
1106
- if (!(GC_FLAGS (ht ) & IS_ARRAY_IMMUTABLE )) {
1107
- GC_ADDREF (ht );
1108
- }
1064
+ GC_TRY_ADDREF (ht );
1109
1065
execute_data = EG (current_execute_data );
1110
1066
opline = EX (opline );
1111
1067
zend_error (E_DEPRECATED , "Using null as an array offset is deprecated, use an empty string instead" );
1112
- if (!( GC_FLAGS ( ht ) & IS_ARRAY_IMMUTABLE ) && GC_DELREF (ht ) != 1 ) {
1068
+ if (GC_DELREF (ht ) != 1 ) {
1113
1069
if (!GC_REFCOUNT (ht )) {
1114
1070
zend_array_destroy (ht );
1115
1071
}
0 commit comments