#41406 [NEW]: try/catch and Exceptions causing an infinite loop

From: Date: Wed, 16 May 2007 07:23:13 +0000
Subject: #41406 [NEW]: try/catch and Exceptions causing an infinite loop
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-112675@lists.php.net to get a copy of this message
From: andrew at alliancesoftware dot com dot au Operating system: Fedora Core release 4 (Stentz) PHP version: 5.2.2 PHP Bug Type: Scripting Engine problem Bug description: try/catch and Exceptions causing an infinite loop 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) -- Edit bug report at http://bugs.php.net/?id=41406&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41406&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41406&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41406&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41406&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41406&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41406&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41406&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41406&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41406&r=support Expected behavior: http://bugs.php.net/fix.php?id=41406&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41406&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41406&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41406&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41406&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41406&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41406&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41406&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41406&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41406&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41406&r=mysqlcfg

« previous php.bugs (#112675) next »