Skip to content

Commit 9369f53

Browse files
committed
#17725 add additional check for mask MAY_BE_STATIC
1 parent 1d353f8 commit 9369f53

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
@@ -572,7 +572,8 @@ static inheritance_status zend_is_class_subtype_of_type(
572572
}
573573

574574
// replacing static with self in final classes is okay
575-
if (!is_intersection && fe_scope->ce_flags & ZEND_ACC_FINAL && instanceof_function(fe_scope, proto_scope)) {
575+
if (!is_intersection && fe_scope->ce_flags & ZEND_ACC_FINAL &&
576+
ZEND_TYPE_FULL_MASK(proto_type) & MAY_BE_STATIC && instanceof_function(fe_scope, proto_scope)) {
576577
if (!fe_ce) fe_ce = lookup_class(fe_scope, fe_class_name);
577578

578579
if (fe_ce && instanceof_function(fe_ce, fe_scope)) {

0 commit comments

Comments
 (0)