@@ -1926,21 +1926,6 @@ ZEND_API uint32_t zend_array_element_type(uint32_t t1, zend_uchar op_type, int w
1926
1926
return tmp ;
1927
1927
}
1928
1928
1929
- static zend_always_inline uint32_t assign_long_dim_array_result_type (uint32_t arr_type )
1930
- {
1931
- /* Rules:
1932
- * HASH_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH
1933
- * PACKED_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG)
1934
- * HASH || PACKED -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG)
1935
- * 0 -> MAY_BE_ARRAY_NUMERIC_HASH
1936
- */
1937
- if (MAY_BE_PACKED (arr_type )) {
1938
- return MAY_BE_ARRAY_KEY_LONG ;
1939
- } else {
1940
- return MAY_BE_ARRAY_NUMERIC_HASH ;
1941
- }
1942
- }
1943
-
1944
1929
static uint32_t assign_dim_array_result_type (
1945
1930
uint32_t arr_type , uint32_t dim_type , uint32_t value_type , zend_uchar dim_op_type ) {
1946
1931
uint32_t tmp = 0 ;
@@ -1954,13 +1939,13 @@ static uint32_t assign_dim_array_result_type(
1954
1939
if (arr_type & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
1955
1940
tmp |= MAY_BE_ARRAY_PACKED ;
1956
1941
}
1957
- tmp |= assign_long_dim_array_result_type (arr_type );
1942
+ tmp |= MAY_BE_HASH_ONLY (arr_type ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
1958
1943
} else {
1959
1944
if (dim_type & (MAY_BE_LONG |MAY_BE_FALSE |MAY_BE_TRUE |MAY_BE_RESOURCE |MAY_BE_DOUBLE )) {
1960
1945
if (arr_type & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
1961
1946
tmp |= MAY_BE_ARRAY_PACKED ;
1962
1947
}
1963
- tmp |= assign_long_dim_array_result_type (arr_type );
1948
+ tmp |= MAY_BE_HASH_ONLY (arr_type ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
1964
1949
}
1965
1950
if (dim_type & MAY_BE_STRING ) {
1966
1951
tmp |= MAY_BE_ARRAY_KEY_STRING ;
@@ -1969,7 +1954,7 @@ static uint32_t assign_dim_array_result_type(
1969
1954
if (arr_type & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
1970
1955
tmp |= MAY_BE_ARRAY_PACKED ;
1971
1956
}
1972
- tmp |= assign_long_dim_array_result_type (arr_type );
1957
+ tmp |= MAY_BE_HASH_ONLY (arr_type ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
1973
1958
}
1974
1959
}
1975
1960
if (dim_type & (MAY_BE_UNDEF |MAY_BE_NULL )) {
@@ -3269,15 +3254,17 @@ static zend_always_inline int _zend_update_type_info(
3269
3254
key_type |= MAY_BE_ARRAY_PACKED ;
3270
3255
}
3271
3256
if (t1 & MAY_BE_ARRAY ) {
3272
- key_type |= assign_long_dim_array_result_type (t1 );
3257
+ key_type |= MAY_BE_HASH_ONLY (t1 ) ?
3258
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3273
3259
}
3274
3260
} else {
3275
3261
if (t2 & (MAY_BE_LONG |MAY_BE_FALSE |MAY_BE_TRUE |MAY_BE_RESOURCE |MAY_BE_DOUBLE )) {
3276
3262
if (t1 & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
3277
3263
key_type |= MAY_BE_ARRAY_PACKED ;
3278
3264
}
3279
3265
if (t1 & MAY_BE_ARRAY ) {
3280
- key_type |= assign_long_dim_array_result_type (t1 );
3266
+ key_type |= MAY_BE_HASH_ONLY (t1 ) ?
3267
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3281
3268
}
3282
3269
}
3283
3270
if (t2 & MAY_BE_STRING ) {
@@ -3288,7 +3275,8 @@ static zend_always_inline int _zend_update_type_info(
3288
3275
key_type |= MAY_BE_ARRAY_PACKED ;
3289
3276
}
3290
3277
if (t1 & MAY_BE_ARRAY ) {
3291
- key_type |= assign_long_dim_array_result_type (t1 );
3278
+ key_type |= MAY_BE_HASH_ONLY (t1 ) ?
3279
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3292
3280
}
3293
3281
}
3294
3282
}
0 commit comments