@@ -2130,7 +2130,7 @@ ZEND_API uint32_t ZEND_FASTCALL zend_array_type_info(const zval *zv)
21302130}
21312131
21322132
2133- ZEND_API uint32_t zend_array_element_type (uint32_t t1 , uint8_t op_type , bool write , bool insert )
2133+ ZEND_API uint32_t zend_array_element_type (uint32_t t1 , uint8_t op_type , bool write , bool insert , bool is )
21342134{
21352135 uint32_t tmp = 0 ;
21362136
@@ -2149,7 +2149,7 @@ ZEND_API uint32_t zend_array_element_type(uint32_t t1, uint8_t op_type, bool wri
21492149 if (insert ) {
21502150 tmp |= MAY_BE_NULL ;
21512151 } else {
2152- tmp |= MAY_BE_NULL | ((t1 & MAY_BE_ARRAY_OF_ANY ) >> MAY_BE_ARRAY_SHIFT );
2152+ tmp |= ( is ? MAY_BE_UNDEF : MAY_BE_NULL ) | ((t1 & MAY_BE_ARRAY_OF_ANY ) >> MAY_BE_ARRAY_SHIFT );
21532153 if (tmp & MAY_BE_ARRAY ) {
21542154 tmp |= MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF ;
21552155 }
@@ -2760,7 +2760,7 @@ static zend_always_inline zend_result _zend_update_type_info(
27602760 tmp |= MAY_BE_REF ;
27612761 }
27622762 orig = t1 ;
2763- t1 = zend_array_element_type (t1 , opline -> op1_type , 1 , 0 );
2763+ t1 = zend_array_element_type (t1 , opline -> op1_type , 1 , 0 , false );
27642764 t2 = OP1_DATA_INFO ();
27652765 } else if (opline -> opcode == ZEND_ASSIGN_STATIC_PROP_OP ) {
27662766 prop_info = zend_fetch_static_prop_info (script , op_array , ssa , opline );
@@ -3741,12 +3741,13 @@ static zend_always_inline zend_result _zend_update_type_info(
37413741 opline -> op1_type ,
37423742 opline -> opcode != ZEND_FETCH_DIM_R && opline -> opcode != ZEND_FETCH_DIM_IS
37433743 && opline -> opcode != ZEND_FETCH_LIST_R ,
3744- opline -> op2_type == IS_UNUSED );
3744+ opline -> op2_type == IS_UNUSED ,
3745+ opline -> opcode == ZEND_FETCH_DIM_IS );
37453746 if (opline -> opcode == ZEND_FETCH_DIM_FUNC_ARG && (t1 & (MAY_BE_TRUE |MAY_BE_LONG |MAY_BE_DOUBLE |MAY_BE_RESOURCE ))) {
37463747 tmp |= MAY_BE_NULL ;
37473748 }
37483749 if (opline -> opcode == ZEND_FETCH_DIM_IS && (t1 & MAY_BE_STRING )) {
3749- tmp |= MAY_BE_NULL ;
3750+ tmp |= MAY_BE_UNDEF ;
37503751 }
37513752 if ((tmp & (MAY_BE_RC1 |MAY_BE_RCN )) == MAY_BE_RCN && opline -> result_type == IS_TMP_VAR ) {
37523753 /* refcount may be indirectly decremented. Make an exception if the result is used in the next instruction */
0 commit comments