Skip to content

Commit baa7b49

Browse files
committed
#17725 fix checking inheritance while replacing static with self in final classes
1 parent 31c53e4 commit baa7b49

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Zend/zend_inheritance.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,12 @@ static inheritance_status zend_is_class_subtype_of_type(
572572
}
573573

574574
if (!is_intersection && fe_scope->ce_flags & ZEND_ACC_FINAL && instanceof_function(fe_scope, proto_scope)) {
575+
if (!fe_ce) fe_ce = lookup_class(fe_scope, fe_class_name);
576+
577+
if (!fe_ce || !instanceof_function(fe_ce, fe_scope)) {
578+
return INHERITANCE_ERROR;
579+
}
580+
575581
return INHERITANCE_SUCCESS;
576582
}
577583

0 commit comments

Comments
 (0)