summaryrefslogtreecommitdiff
path: root/Zend/zend_inheritance.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-03-27 16:58:30 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-05-07 13:45:28 +0200
commitfd2db1192997f5778139ea8e9d25189c7c08af2c (patch)
tree242059c49aa51b47b6edc30a404fbc2dce764b49 /Zend/zend_inheritance.c
parent49c4ab3c394a6e18ab09582bccf6a26d88c4a616 (diff)
downloadphp-git-fd2db1192997f5778139ea8e9d25189c7c08af2c.tar.gz
Always generate fatal error for LSP failures
RFC: https://wiki.php.net/rfc/lsp_errors
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r--Zend/zend_inheritance.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index a4e437f271..48e277d5d8 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -633,29 +633,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
}
if (UNEXPECTED(!zend_do_perform_implementation_check(child, parent))) {
- int error_level;
- const char *error_verb;
zend_string *method_prototype = zend_get_function_declaration(parent);
zend_string *child_prototype = zend_get_function_declaration(child);
-
- if (child->common.prototype && (
- child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT
- )) {
- error_level = E_COMPILE_ERROR;
- error_verb = "must";
- } else if ((parent->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) &&
- (!(child->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
- !zend_do_perform_type_hint_check(child, child->common.arg_info - 1, parent, parent->common.arg_info - 1) ||
- (ZEND_TYPE_ALLOW_NULL(child->common.arg_info[-1].type) && !ZEND_TYPE_ALLOW_NULL(parent->common.arg_info[-1].type)))) {
- error_level = E_COMPILE_ERROR;
- error_verb = "must";
- } else {
- error_level = E_WARNING;
- error_verb = "should";
- }
- zend_error_at(error_level, NULL, func_lineno(child),
- "Declaration of %s %s be compatible with %s",
- ZSTR_VAL(child_prototype), error_verb, ZSTR_VAL(method_prototype));
+ zend_error_at(E_COMPILE_ERROR, NULL, func_lineno(child),
+ "Declaration of %s must be compatible with %s",
+ ZSTR_VAL(child_prototype), ZSTR_VAL(method_prototype));
zend_string_efree(child_prototype);
zend_string_efree(method_prototype);
}