From 058554810649da431efa3ab851be17b0d2f96fb8 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 27 Mar 2019 18:09:09 +0100 Subject: Treat abstract ctors the same, regardless of origin Abstract ctor signatures should always be respected by all children, independently of whether it comes from an interface or an abstract class. Previously abstract ctor signatures (if they didn't come from an interface) were only checked to one level of inheritance. --- Zend/zend_inheritance.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Zend/zend_inheritance.c') diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 72bc9cfaae..0916d91f77 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -597,11 +597,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * proto = parent; } } else if (proto) { - if (proto->common.scope->ce_flags & ZEND_ACC_INTERFACE) { - /* ctors only have a prototype if it comes from an interface */ - /* and if that is the case, we want to check inheritance against it */ + /* ctors only have a prototype if is abstract (or comes from an interface) */ + /* and if that is the case, we want to check inheritance against it */ + if (proto->common.fn_flags & ZEND_ACC_ABSTRACT) { parent = proto; - } else if (!(proto->common.fn_flags & ZEND_ACC_ABSTRACT)) { + } else { break; } } else { -- cgit v1.2.1