diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-27 18:09:09 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-27 18:09:09 +0100 |
commit | 058554810649da431efa3ab851be17b0d2f96fb8 (patch) | |
tree | bd73b6013de0e2616f8d291bba3d2d668fa61f67 /Zend/zend_inheritance.c | |
parent | d1e5006c1487c0df1333564c3fdcc0528e1da394 (diff) | |
download | php-git-058554810649da431efa3ab851be17b0d2f96fb8.tar.gz |
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.
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r-- | Zend/zend_inheritance.c | 8 |
1 files changed, 4 insertions, 4 deletions
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 { |