@@ -1099,8 +1099,7 @@ static zend_always_inline bool zend_value_instanceof_static(zval *zv) {
10991099 return instanceof_function (Z_OBJCE_P (zv ), called_scope );
11001100}
11011101
1102- // TODO: new name
1103- static zend_always_inline zend_class_entry * zend_fetch_ce_from_cache_slot (
1102+ static zend_always_inline zend_class_entry * zend_fetch_ce_from_type (
11041103 zend_type * type )
11051104{
11061105 zend_string * name = ZEND_TYPE_NAME (* type );
@@ -1124,13 +1123,13 @@ static zend_always_inline zend_class_entry *zend_fetch_ce_from_cache_slot(
11241123 return ce ;
11251124}
11261125
1127- static bool zend_check_intersection_type_from_cache_slot (zend_type_list * intersection_type_list ,
1126+ static bool zend_check_intersection_type_from_list (zend_type_list * intersection_type_list ,
11281127 zend_class_entry * arg_ce )
11291128{
11301129 zend_class_entry * ce ;
11311130 zend_type * list_type ;
11321131 ZEND_TYPE_LIST_FOREACH (intersection_type_list , list_type ) {
1133- ce = zend_fetch_ce_from_cache_slot (list_type );
1132+ ce = zend_fetch_ce_from_type (list_type );
11341133 /* If type is not an instance of one of the types taking part in the
11351134 * intersection it cannot be a valid instance of the whole intersection type. */
11361135 if (!ce || !instanceof_function (arg_ce , ce )) {
@@ -1150,16 +1149,16 @@ static zend_always_inline bool zend_check_type_slow(
11501149 if (UNEXPECTED (ZEND_TYPE_HAS_LIST (* type ))) {
11511150 zend_type * list_type ;
11521151 if (ZEND_TYPE_IS_INTERSECTION (* type )) {
1153- return zend_check_intersection_type_from_cache_slot (ZEND_TYPE_LIST (* type ), Z_OBJCE_P (arg ));
1152+ return zend_check_intersection_type_from_list (ZEND_TYPE_LIST (* type ), Z_OBJCE_P (arg ));
11541153 } else {
11551154 ZEND_TYPE_LIST_FOREACH (ZEND_TYPE_LIST (* type ), list_type ) {
11561155 if (ZEND_TYPE_IS_INTERSECTION (* list_type )) {
1157- if (zend_check_intersection_type_from_cache_slot (ZEND_TYPE_LIST (* list_type ), Z_OBJCE_P (arg ))) {
1156+ if (zend_check_intersection_type_from_list (ZEND_TYPE_LIST (* list_type ), Z_OBJCE_P (arg ))) {
11581157 return true;
11591158 }
11601159 } else {
11611160 ZEND_ASSERT (!ZEND_TYPE_HAS_LIST (* list_type ));
1162- ce = zend_fetch_ce_from_cache_slot (list_type );
1161+ ce = zend_fetch_ce_from_type (list_type );
11631162 /* Instance of a single type part of a union is sufficient to pass the type check */
11641163 if (ce && instanceof_function (Z_OBJCE_P (arg ), ce )) {
11651164 return true;
@@ -1168,7 +1167,7 @@ static zend_always_inline bool zend_check_type_slow(
11681167 } ZEND_TYPE_LIST_FOREACH_END ();
11691168 }
11701169 } else {
1171- ce = zend_fetch_ce_from_cache_slot (type );
1170+ ce = zend_fetch_ce_from_type (type );
11721171 /* If we have a CE we check if it satisfies the type constraint,
11731172 * otherwise it will check if a standard type satisfies it. */
11741173 if (ce && instanceof_function (Z_OBJCE_P (arg ), ce )) {
0 commit comments