|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-03-31 14:43 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2021-03-31 14:43 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 09:00:01 2025 UTC |
Description: ------------ Exceptions nesting a previous exception result in misleading error-reports. In the test script below, Foo was actually caught and nested in an uncaught Bar. The resulting fatal error errorneously suggests, that Foo was not caught. Test script: --------------- class Foo extends \Exception {}; class Bar extends \Exception {}; try { throw new Foo('Foo-message'); } catch (Foo $e) { throw new Bar('Bar-message', 4711, $e); } Expected result: ---------------- Fatal error: Uncaught exception 'Bar' with message 'Bar-message' in test.php on line 8 Foo: Foo-message in test.php on line 6 Call Stack: 0.0002 269440 1. {main}() test.php:0 Bar: Bar-message in test.php on line 8 Call Stack: 0.0002 269440 1. {main}() test.php:0 Actual result: -------------- Fatal error: Uncaught exception 'Foo' with message 'Foo-message' in test.php on line 8 Foo: Foo-message in test.php on line 6 Call Stack: 0.0002 269440 1. {main}() test.php:0 Bar: Bar-message in test.php on line 8 Call Stack: 0.0002 269440 1. {main}() test.php:0