PHPDbg misidentifies uncaught exception when exception is not yet loaded
Offen
Dieses Issue hat noch niemand übernommen.
Bug
SAPI: phpdbg
Status: Needs Triage
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.1k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
Description
The following code:
<?php declare(strict_types=1);
try {
throw new RuntimeException();
} catch (LibrarySpecificException) {
// A library specific exception. Not autoloaded since it did not happen.
} catch (RuntimeException) {
echo "Caught it. 'handled' it\n";
}
When run via php or phpdbg -qrr Resulted in this output:
Caught it. 'handled' it
But when run via phpdbg -r resulted in output:
[Welcome to phpdbg, the interactive PHP debugger, v8.5.6]
To get help using phpdbg type "help" and press enter
[Please report bugs to <https://github.com/php/php-src/issues>]
[PHP Fatal error: During class fetch: Uncaught RuntimeException in /src/demo.php:4
Stack trace:
#0 {main} in /src/demo.php on line 4
Stack trace:
#0 {main}]
>00004: throw new RuntimeException();
00005: } catch (LibrarySpecificException) {
00006: // A library specific exception. Not autoloaded since it did not happen.
prompt>
PHP Version
PHP 8.5.6 (cli) (built: May 8 2026 16:44:06) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.5.6, Copyright (c) Zend Technologies
with Zend OPcache v8.5.6, Copyright (c), by Zend Technologies
PHP 8.4.20 (cli) (built: Apr 8 2026 08:16:38) (NTS gcc x86_64)
Copyright (c) The PHP Group
Built by Amazon Linux
Zend Engine v4.4.20, Copyright (c) Zend Technologies
with Zend OPcache v8.4.20, Copyright (c), by Zend Technologies
Operating System
Alpine3.22 and Amazon Linx 2023
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das bereitgestellte Skript sowohl mit phpdbg -r als auch mit phpdbg -qrr und vergleiche beide mit php. Beginne beim phpdbg-Ausführungspfad, der am Abruf von Klassen und an der Ausnahmebehandlung beteiligt ist; abgeschlossen ist die Aufgabe, wenn der Aufruf mit -r die nicht abgefangene RuntimeException konsistent erkennt und das erwartete Catch-Verhalten beibehält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- php
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100