#33612 [Bgs->Opn]: Uncaught exceptions do not always give an error
| From: | james at academicsuperstore dot com | Date: | Thu, 07 Jul 2005 22:30:17 +0000 |
| Subject: | #33612 [Bgs->Opn]: Uncaught exceptions do not always give an error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81560@lists.php.net to get a copy of this message | ||
ID: 33612
User updated by: james at academicsuperstore dot com
Reported By: james at academicsuperstore dot com
-Status: Bogus
+Status: Open
Bug Type: Unknown/Other Function
Operating System: Debian -stable
PHP Version: 5.0.4
New Comment:
I re-read the documentation. This is non-obvious based on the docs.
In fact it is exactly the opposite behavior from java and c++ which is
why I assume it is a bug. If the programmer fails to catch exceptions
and a corner case doesn't come up until a site is deployed there is
nothing the programmer can do. In the event that php always informed
you via a notice or some other method that you forgot to catch an
exception then this issue would not come up.
Previous Comments:
------------------------------------------------------------------------
[2005-07-08 00:16:30] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
------------------------------------------------------------------------
[2005-07-08 00:01:04] james at academicsuperstore dot com
Description:
------------
In the event at run time an uncaught exception is found then there is a
fatal error. However, in the event that there are uncaught exceptions
that are not executed such as in the reproduce code there is not even a
notice.
Reproduce code:
---------------
<?
error_reporting(2047 | E_STRICT);
if (0)
throw new Exception("foo");
?>
Expected result:
----------------
Fatal error: Uncaught exception 'Exception' with message 'foo' in
/home/james/html/live_web/test.php:5 Stack trace: #0
Actual result:
--------------
No messages at all.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33612&edit=1