@@ -411,8 +411,8 @@ static inheritance_status zend_perform_intersection_covariant_class_type_check(
411
411
bool have_unresolved = false;
412
412
zend_type * single_type ;
413
413
414
- /* Traverse the list of child types and check if it is either a subtype
415
- * of one of the parent types OR is not in the parent type list */
414
+ /* Traverse the list of child types and check that at least one is
415
+ * a subtype of the parent type being checked */
416
416
ZEND_TYPE_FOREACH (fe_type , single_type ) {
417
417
zend_class_entry * fe_ce ;
418
418
zend_string * fe_class_name = NULL ;
@@ -431,7 +431,7 @@ static inheritance_status zend_perform_intersection_covariant_class_type_check(
431
431
fe_ce = ZEND_TYPE_CE (* single_type );
432
432
} else {
433
433
/* standard type */
434
- ZEND_ASSERT ( 0 && "This shouldn't happen yet" );
434
+ ZEND_UNREACHABLE ( );
435
435
continue ;
436
436
}
437
437
@@ -544,7 +544,7 @@ static inheritance_status zend_is_single_type_subtype_intersection(
544
544
proto_ce = ZEND_TYPE_CE (* single_type );
545
545
} else {
546
546
/* standard type cannot be part a subtype of an intersection type */
547
- ZEND_ASSERT ( 0 && "This shouldn't happen yet" );
547
+ ZEND_UNREACHABLE ( );
548
548
continue ;
549
549
}
550
550
@@ -624,7 +624,7 @@ static inheritance_status zend_perform_covariant_type_check(
624
624
bool all_success = true;
625
625
626
626
/* If the child type is an intersection type then we need to loop over
627
- * the parents firstFor intersection types loop over the parent types first
627
+ * the parents first. For intersection types, loop over the parent types first
628
628
* as the child can add types, however none of them can be a supertype of
629
629
* a parent type. */
630
630
if (ZEND_TYPE_IS_INTERSECTION (fe_type )) {
@@ -641,7 +641,7 @@ static inheritance_status zend_perform_covariant_type_check(
641
641
proto_class_name = proto_ce -> name ;
642
642
} else {
643
643
/* standard type */
644
- ZEND_ASSERT ( 0 && "This shouldn't happen yet" );
644
+ ZEND_UNREACHABLE ( );
645
645
continue ;
646
646
}
647
647
0 commit comments