summaryrefslogtreecommitdiff
path: root/Zend/zend_inheritance.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-03-27 12:42:35 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-03-27 12:42:35 +0100
commit251f293cb7e6fa603885e912e455725efe4cd94e (patch)
tree9a47b7c353be68effec0d5817ea593b2f545fe50 /Zend/zend_inheritance.c
parentfd5d6597790ccc412b7781ee344a03affc5aa2a5 (diff)
downloadphp-git-251f293cb7e6fa603885e912e455725efe4cd94e.tar.gz
Make line numbers for inheritance errors more precise
Use the line of the conflicting child method, rather than either the first or last line of the class.
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r--Zend/zend_inheritance.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 1da300f68f..f7cb37e2df 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -639,7 +639,10 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
error_level = E_WARNING;
error_verb = "should";
}
- zend_error(error_level, "Declaration of %s %s be compatible with %s", ZSTR_VAL(child_prototype), error_verb, ZSTR_VAL(method_prototype));
+ zend_error_at(error_level, NULL,
+ child->common.type == ZEND_USER_FUNCTION ? child->op_array.line_start : 0,
+ "Declaration of %s %s be compatible with %s",
+ ZSTR_VAL(child_prototype), error_verb, ZSTR_VAL(method_prototype));
zend_string_efree(child_prototype);
zend_string_efree(method_prototype);
}