@@ -399,13 +399,13 @@ static void track_class_dependency(zend_class_entry *ce, zend_string *class_name
399
399
zend_hash_add_ptr (ht , class_name , ce );
400
400
}
401
401
402
- /* Check whether any type in fe_type is a subtype of the proto class.
403
- * This is independently of whether fe_type is a union or intersection. */
404
- static inheritance_status zend_is_any_type_subtype_of_class (
402
+ /* Check whether any type in the fe_type intersection type is a subtype of the proto class. */
403
+ static inheritance_status zend_is_intersection_subtype_of_class (
405
404
zend_class_entry * fe_scope , zend_type fe_type ,
406
405
zend_class_entry * proto_scope , zend_string * proto_class_name , zend_class_entry * proto_ce ,
407
406
bool register_unresolved )
408
407
{
408
+ ZEND_ASSERT (ZEND_TYPE_IS_INTERSECTION (fe_type ));
409
409
bool have_unresolved = false;
410
410
zend_type * single_type ;
411
411
@@ -605,7 +605,7 @@ static inheritance_status zend_perform_covariant_type_check(
605
605
continue ;
606
606
}
607
607
608
- status = zend_is_any_type_subtype_of_class (
608
+ status = zend_is_intersection_subtype_of_class (
609
609
fe_scope , fe_type , proto_scope , proto_class_name , proto_ce ,
610
610
/* register_unresolved */ false);
611
611
if (status == early_exit_status ) {
@@ -668,7 +668,7 @@ static inheritance_status zend_perform_covariant_type_check(
668
668
continue ;
669
669
}
670
670
671
- zend_is_any_type_subtype_of_class (
671
+ zend_is_intersection_subtype_of_class (
672
672
fe_scope , fe_type , proto_scope , proto_class_name , proto_ce ,
673
673
/* register_unresolved */ true);
674
674
} ZEND_TYPE_FOREACH_END ();
0 commit comments