@@ -1926,21 +1926,6 @@ ZEND_API uint32_t zend_array_element_type(uint32_t t1, zend_uchar op_type, int w
19261926 return tmp ;
19271927}
19281928
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-
19441929static uint32_t assign_dim_array_result_type (
19451930 uint32_t arr_type , uint32_t dim_type , uint32_t value_type , zend_uchar dim_op_type ) {
19461931 uint32_t tmp = 0 ;
@@ -1954,13 +1939,13 @@ static uint32_t assign_dim_array_result_type(
19541939 if (arr_type & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
19551940 tmp |= MAY_BE_ARRAY_PACKED ;
19561941 }
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 ;
19581943 } else {
19591944 if (dim_type & (MAY_BE_LONG |MAY_BE_FALSE |MAY_BE_TRUE |MAY_BE_RESOURCE |MAY_BE_DOUBLE )) {
19601945 if (arr_type & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
19611946 tmp |= MAY_BE_ARRAY_PACKED ;
19621947 }
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 ;
19641949 }
19651950 if (dim_type & MAY_BE_STRING ) {
19661951 tmp |= MAY_BE_ARRAY_KEY_STRING ;
@@ -1969,7 +1954,7 @@ static uint32_t assign_dim_array_result_type(
19691954 if (arr_type & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
19701955 tmp |= MAY_BE_ARRAY_PACKED ;
19711956 }
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 ;
19731958 }
19741959 }
19751960 if (dim_type & (MAY_BE_UNDEF |MAY_BE_NULL )) {
@@ -3269,15 +3254,17 @@ static zend_always_inline int _zend_update_type_info(
32693254 key_type |= MAY_BE_ARRAY_PACKED ;
32703255 }
32713256 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 ;
32733259 }
32743260 } else {
32753261 if (t2 & (MAY_BE_LONG |MAY_BE_FALSE |MAY_BE_TRUE |MAY_BE_RESOURCE |MAY_BE_DOUBLE )) {
32763262 if (t1 & (MAY_BE_UNDEF |MAY_BE_NULL |MAY_BE_FALSE )) {
32773263 key_type |= MAY_BE_ARRAY_PACKED ;
32783264 }
32793265 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 ;
32813268 }
32823269 }
32833270 if (t2 & MAY_BE_STRING ) {
@@ -3288,7 +3275,8 @@ static zend_always_inline int _zend_update_type_info(
32883275 key_type |= MAY_BE_ARRAY_PACKED ;
32893276 }
32903277 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 ;
32923280 }
32933281 }
32943282 }
0 commit comments