mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
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.
This commit is contained in:
parent
fd5d659779
commit
251f293cb7
13 changed files with 16 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue