Cannot redeclare previously declared ambiguity
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
Reproduce the PHP 8.3.32 scenario described with errors.php included again from test.php, and start by tracing the fatal redeclaration diagnostic shown in error.log. Done means the error identifies the second include location while preserving the existing declaration details and line information.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
PHP 8.3.32
Operating System
No response
- Lingua principale
- C
- Stelle
- 40.4k
- Fork
- 8.2k
- Merge medio
- 2g 17h
- PR unite (30g)
- 115
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di php/php-src
-
Bug Status: Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Bug Status: Needs Triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Bug Status: Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Flaky hrtime.phpt test ApertaBug Category: Tests Status: Verified
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Bug SAPI: fpm Status: Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
bradcypert/plum#53 ·
-
Component: GLib
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Status: Opened
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
nextbsd/nextbsd-userland#285 ·