Skip to content

Commit 33a7f22

Browse files
committed
Fix variance
1 parent 4c0e600 commit 33a7f22

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Zend/zend_inheritance.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,8 @@ static inheritance_status zend_perform_covariant_type_check(
539539
/* Builtin types may be removed, but not added */
540540
uint32_t fe_type_mask = ZEND_TYPE_PURE_MASK(fe_type);
541541
uint32_t proto_type_mask = ZEND_TYPE_PURE_MASK(proto_type);
542-
uint32_t added_types = fe_type_mask & ~proto_type_mask;
542+
/* MAY_BE_ITERABLE is only used for BC with Reflection so remove it */
543+
uint32_t added_types = fe_type_mask & ~proto_type_mask & ~MAY_BE_ITERABLE;
543544
if (added_types) {
544545
if ((added_types & MAY_BE_STATIC)
545546
&& zend_type_permits_self(proto_type, proto_scope, fe_scope)) {

0 commit comments

Comments
 (0)