Skip to content

Commit e1a02fc

Browse files
committed
Fix variance
1 parent 354e1f0 commit e1a02fc

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
@@ -540,7 +540,8 @@ static inheritance_status zend_perform_covariant_type_check(
540540
/* Builtin types may be removed, but not added */
541541
uint32_t fe_type_mask = ZEND_TYPE_PURE_MASK(fe_type);
542542
uint32_t proto_type_mask = ZEND_TYPE_PURE_MASK(proto_type);
543-
uint32_t added_types = fe_type_mask & ~proto_type_mask;
543+
/* MAY_BE_ITERABLE is only used for BC with Reflection so remove it */
544+
uint32_t added_types = fe_type_mask & ~proto_type_mask & ~MAY_BE_ITERABLE;
544545
if (added_types) {
545546
if ((added_types & MAY_BE_STATIC)
546547
&& zend_type_permits_self(proto_type, proto_scope, fe_scope)) {

0 commit comments

Comments
 (0)