Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  Fix lineno in function redeclaration error
This commit is contained in:
Ilija Tovilo 2024-10-22 15:06:06 +02:00
commit cd8ee4dad1
No known key found for this signature in database
GPG key ID: 5050C66BFCD1015A
5 changed files with 24 additions and 3 deletions

View file

@ -175,13 +175,13 @@ failure:
function2 = Z_PTR_P(t);
CG(in_compilation) = 1;
zend_set_compiled_filename(function1->op_array.filename);
CG(zend_lineno) = function1->op_array.opcodes[0].lineno;
CG(zend_lineno) = function1->op_array.line_start;
if (function2->type == ZEND_USER_FUNCTION
&& function2->op_array.last > 0) {
zend_error_noreturn(E_ERROR, "Cannot redeclare function %s() (previously declared in %s:%d)",
ZSTR_VAL(function1->common.function_name),
ZSTR_VAL(function2->op_array.filename),
(int)function2->op_array.opcodes[0].lineno);
(int)function2->op_array.line_start);
} else {
zend_error_noreturn(E_ERROR, "Cannot redeclare function %s()", ZSTR_VAL(function1->common.function_name));
}