@@ -1942,21 +1942,6 @@ ZEND_API uint32_t zend_array_element_type(uint32_t t1, zend_uchar op_type, int w
1942
1942
return tmp ;
1943
1943
}
1944
1944
1945
- static zend_always_inline uint32_t assign_long_dim_array_result_type (uint32_t arr_type )
1946
- {
1947
- /* Rules:
1948
- * HASH_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH
1949
- * PACKED_ONLY -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG)
1950
- * HASH || PACKED -> MAY_BE_ARRAY_NUMERIC_HASH | MAY_BE_ARRAY_PACKED (== MAY_BE_ARRAY_KEY_LONG)
1951
- * 0 -> MAY_BE_ARRAY_NUMERIC_HASH
1952
- */
1953
- if (MAY_BE_PACKED (arr_type )) {
1954
- return MAY_BE_ARRAY_KEY_LONG ;
1955
- } else {
1956
- return MAY_BE_ARRAY_NUMERIC_HASH ;
1957
- }
1958
- }
1959
-
1960
1945
static uint32_t assign_dim_array_result_type (
1961
1946
uint32_t arr_type , uint32_t dim_type , uint32_t value_type , zend_uchar dim_op_type ) {
1962
1947
uint32_t tmp = 0 ;
@@ -1970,13 +1955,13 @@ static uint32_t assign_dim_array_result_type(
1970
1955
if (arr_type & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
1971
1956
tmp |= MAY_BE_ARRAY_PACKED ;
1972
1957
}
1973
- tmp |= assign_long_dim_array_result_type (arr_type );
1958
+ tmp |= MAY_BE_HASH_ONLY (arr_type ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
1974
1959
} else {
1975
1960
if (dim_type & (MAY_BE_LONG |MAY_BE_FALSE |MAY_BE_TRUE |MAY_BE_RESOURCE |MAY_BE_DOUBLE )) {
1976
1961
if (arr_type & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
1977
1962
tmp |= MAY_BE_ARRAY_PACKED ;
1978
1963
}
1979
- tmp |= assign_long_dim_array_result_type (arr_type );
1964
+ tmp |= MAY_BE_HASH_ONLY (arr_type ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
1980
1965
}
1981
1966
if (dim_type & MAY_BE_STRING ) {
1982
1967
tmp |= MAY_BE_ARRAY_KEY_STRING ;
@@ -1985,7 +1970,7 @@ static uint32_t assign_dim_array_result_type(
1985
1970
if (arr_type & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
1986
1971
tmp |= MAY_BE_ARRAY_PACKED ;
1987
1972
}
1988
- tmp |= assign_long_dim_array_result_type (arr_type );
1973
+ tmp |= MAY_BE_HASH_ONLY (arr_type ) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
1989
1974
}
1990
1975
}
1991
1976
if (dim_type & (MAY_BE_UNDEF |MAY_BE_NULL )) {
@@ -3301,15 +3286,17 @@ static zend_always_inline zend_result _zend_update_type_info(
3301
3286
key_type |= MAY_BE_ARRAY_PACKED ;
3302
3287
}
3303
3288
if (t1 & MAY_BE_ARRAY ) {
3304
- key_type |= assign_long_dim_array_result_type (t1 );
3289
+ key_type |= MAY_BE_HASH_ONLY (t1 ) ?
3290
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3305
3291
}
3306
3292
} else {
3307
3293
if (t2 & (MAY_BE_LONG |MAY_BE_FALSE |MAY_BE_TRUE |MAY_BE_RESOURCE |MAY_BE_DOUBLE )) {
3308
3294
if (t1 & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
3309
3295
key_type |= MAY_BE_ARRAY_PACKED ;
3310
3296
}
3311
3297
if (t1 & MAY_BE_ARRAY ) {
3312
- key_type |= assign_long_dim_array_result_type (t1 );
3298
+ key_type |= MAY_BE_HASH_ONLY (t1 ) ?
3299
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3313
3300
}
3314
3301
}
3315
3302
if (t2 & MAY_BE_STRING ) {
@@ -3320,7 +3307,8 @@ static zend_always_inline zend_result _zend_update_type_info(
3320
3307
key_type |= MAY_BE_ARRAY_PACKED ;
3321
3308
}
3322
3309
if (t1 & MAY_BE_ARRAY ) {
3323
- key_type |= assign_long_dim_array_result_type (t1 );
3310
+ key_type |= MAY_BE_HASH_ONLY (t1 ) ?
3311
+ MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG ;
3324
3312
}
3325
3313
}
3326
3314
}
0 commit comments