|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-05-16 07:23 UTC] andrew at alliancesoftware dot com dot au
Description:
------------
If i throw an exception in a try/catch block, and then try throwing the same type of exception after the try/catch block has ended it will infinitely loop through the catch block.
Reproduce code:
---------------
try {
throw new Exception('first');
} catch (Exception $e) {
print $e->getMessage()."\n";
}
throw new Exception('second');
Expected result:
----------------
Should just print 'first' and then exit with an uncaught Exception.
Actual result:
--------------
It prints 'first' as expected, but then goes on to infinitely loop through the catch block again printing 'second' from the latter exception (that is outside the catch block)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 23 12:00:01 2025 UTC |
Cannot reproduce: first Fatal error: Uncaught exception 'Exception' with message 'second' in /tmp/3.php:8 Stack trace: #0 {main} thrown in /tmp/3.php on line 8