Inheritance checks should not ignore parents if these implement an interface

This commit is contained in:
Pedro Magalhães 2017-01-26 23:50:56 +01:00 committed by Joe Watkins
parent bf914ff75a
commit b67eb3440b
No known key found for this signature in database
GPG key ID: F9BA0ADA31CBD89E
4 changed files with 41 additions and 6 deletions

View file

@ -607,13 +607,12 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
} else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) {
/* ctors only have a prototype if it comes from an interface */
child->common.prototype = parent->common.prototype ? parent->common.prototype : parent;
/* and if that is the case, we want to check inheritance against it */
if (parent->common.fn_flags & ZEND_ACC_CTOR) {
parent = child->common.prototype;
}
}
if (child->common.prototype && (
child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT
)) {
parent = child->common.prototype;
}
if (UNEXPECTED(!zend_do_perform_implementation_check(child, parent))) {
int error_level;
const char *error_verb;