|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-07-02 20:06 UTC] jonathan dot lung at utoronto dot ca
Description:
------------
The exception handler seems to behave strangely.
Reproduce code:
---------------
<?
echo "loopy";
try {
echo " code\n";
}
catch (Exception $e) {
echo "Really.";
}
?>
Expected result:
----------------
The words "loopy code\n" to be printed out.
Actual result:
--------------
The words "loopy code\n" run in a continuous loop (yes,
even the word "loopy"). This problem seems to go away
with the following:
<?
if (true) {
echo "loopy";
try {
echo " code\n";
}
catch (Exception $e) {
echo "Really.";
}
}
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 07:00:01 2025 UTC |
if (true) { try { throw new Exception("Blah"); } catch (Exception $e) { echo $e->getMessage(); } } also does not behave as expected. This causes an "uncaught exception" error to occur. (Both problems listed occur from running from command line in interactive mode). The above works if it is further surrounded by a try/catch block.