Skip to content

Commit ed3b2ea

Browse files
committed
Fix variance when parent does not have an intesection type
1 parent b5da6c4 commit ed3b2ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_inheritance.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ static inheritance_status zend_perform_covariant_type_check(
546546

547547
/* For intersection types loop over the parent types first as a child
548548
* can add them */
549-
if (ZEND_TYPE_HAS_INTERSECTION(proto_type)) {
549+
if (ZEND_TYPE_HAS_INTERSECTION(proto_type) || ZEND_TYPE_HAS_INTERSECTION(fe_type)) {
550550
/* First try to check whether we can succeed without resolving anything */
551551
ZEND_TYPE_FOREACH(proto_type, single_type) {
552552
inheritance_status status;

0 commit comments

Comments
 (0)