[php-src] Issue #23852: Cannot redeclare previously declared ambiguity
| From: | jabcreations | Date: | Tue, 22 Sep 2026 19:55:27 +0000 |
| Subject: | [php-src] Issue #23852: Cannot redeclare previously declared ambiguity | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-252804@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/23852
Author: jabcreations
### Description
From an error.log report:
> [22-Sep-2026 18:51:21 UTC] PHP Fatal error: Cannot redeclare example() (previously declared in
> D:\wamp\errors.php:11) in D:\wamp\errors.php on line 11
This ambiguous error has wasted a lot of developer's precious time. It tells us where the
function is declared but it fails to tell us where the file is included a second time. This results
in developers opting to use include_once() instead of include() and tracking down errors in logic.
A proper fix applied to the same scenario should result in the following error report:
> [22-Sep-2026 18:51:21 UTC] PHP Fatal error: Cannot redeclare example() **_from
> D:\wamp\test.php:427_** (previously declared in D:\wamp\errors.php:11) in D:\wamp\errors.php on line
> 11
### PHP Version
```plain
PHP 8.3.32
```
### Operating System
_No response_