Skip to content

Commit 2ceda3f

Browse files
committed
Adjust misleading comment
1 parent 3d63044 commit 2ceda3f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Zend/zend_inheritance.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,13 @@ static void track_class_dependency(zend_class_entry *ce, zend_string *class_name
403403
zend_hash_add_ptr(ht, class_name, ce);
404404
}
405405

406-
/* Check whether any type in fe_type is a subtype of the proto class.
407-
* This is independently of whether fe_type is a union or intersection. */
408-
static inheritance_status zend_is_any_type_subtype_of_class(
406+
/* Check whether any type in the fe_type intersection type is a subtype of the proto class. */
407+
static inheritance_status zend_is_intersection_subtype_of_class(
409408
zend_class_entry *fe_scope, zend_type fe_type,
410409
zend_class_entry *proto_scope, zend_string *proto_class_name, zend_class_entry *proto_ce,
411410
bool register_unresolved)
412411
{
412+
ZEND_ASSERT(ZEND_TYPE_IS_INTERSECTION(fe_type));
413413
bool have_unresolved = false;
414414
zend_type *single_type;
415415

@@ -617,7 +617,7 @@ static inheritance_status zend_perform_covariant_type_check(
617617
continue;
618618
}
619619

620-
status = zend_is_any_type_subtype_of_class(
620+
status = zend_is_intersection_subtype_of_class(
621621
fe_scope, fe_type, proto_scope, proto_class_name, proto_ce,
622622
/* register_unresolved */ false);
623623
if (status == early_exit_status) {

0 commit comments

Comments
 (0)