summaryrefslogtreecommitdiff
path: root/Zend/zend_inheritance.c
diff options
context:
space:
mode:
authorPedro Magalhães <mail@pmmaga.net>2017-05-21 14:41:55 +0200
committerNikita Popov <nikita.ppv@gmail.com>2017-06-03 00:24:43 +0200
commitc6c1e75e6ba082b6d57f71c28d316b6db4fda6c7 (patch)
treeccb542da14022760daea4271652a0d0c35bf486f /Zend/zend_inheritance.c
parentf2e7cdb8b7a68315c902e9346f476e72370e30e1 (diff)
downloadphp-git-c6c1e75e6ba082b6d57f71c28d316b6db4fda6c7.tar.gz
Fix bug #74607: Don't check for bi-directional compatibility in traits
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r--Zend/zend_inheritance.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 8f43d15600..868a0bddf0 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -1088,7 +1088,6 @@ static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_
uint32_t other_flags = other_fn->common.scope->ce_flags;
return zend_do_perform_implementation_check(fn, other_fn)
- && ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || zend_do_perform_implementation_check(other_fn, fn))
&& ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) ==
(other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal final and static qualifier */
}
@@ -1158,12 +1157,13 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
ZSTR_VAL(zend_get_function_declaration(fn)),
ZSTR_VAL(zend_get_function_declaration(existing_fn)));
}
- } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
+ }
+ if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
/* Make sure the abstract declaration is compatible with previous declaration */
if (UNEXPECTED(!zend_traits_method_compatibility_check(existing_fn, fn))) {
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
- ZSTR_VAL(zend_get_function_declaration(fn)),
- ZSTR_VAL(zend_get_function_declaration(existing_fn)));
+ ZSTR_VAL(zend_get_function_declaration(existing_fn)),
+ ZSTR_VAL(zend_get_function_declaration(fn)));
}
return;
}
@@ -1186,8 +1186,8 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
/* Make sure the abstract declaration is compatible with previous declaration */
if (UNEXPECTED(!zend_traits_method_compatibility_check(existing_fn, fn))) {
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
- ZSTR_VAL(zend_get_function_declaration(fn)),
- ZSTR_VAL(zend_get_function_declaration(existing_fn)));
+ ZSTR_VAL(zend_get_function_declaration(existing_fn)),
+ ZSTR_VAL(zend_get_function_declaration(fn)));
}
return;
} else if (UNEXPECTED(existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT)) {