#40014 [Opn->Bgs]: "try, catch" -- Let's Empower It, Please!!!
| From: | helly@php.net | Date: | Tue, 13 Mar 2007 22:28:36 +0000 |
| Subject: | #40014 [Opn->Bgs]: "try, catch" -- Let's Empower It, Please!!! | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-110316@lists.php.net to get a copy of this message | ||
ID: 40014
Updated by: helly@php.net
Reported By: marcus3v at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
PHP Version: 6CVS-2007-01-03 (CVS)
New Comment:
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
Just register an error handler that throws an exception.
Previous Comments:
------------------------------------------------------------------------
[2007-03-09 22:37:57] bronner dot mike at gmail dot com
Same here, have been getting that behavior as well. Keeping fatal
errors from users would be nice. It would also let us exit gracefully,
and not leave the users hanging.
------------------------------------------------------------------------
[2007-01-03 20:44:54] marcus3v at hotmail dot com
Description:
------------
Hey, men!
What about to enhance the "try, catch" Statement so that the code
inside "try" would transparently cause a Fatal Error that, then, is
handled through the "catch" Blocks -- just as occurs in JavaScript?!
Reproduce code:
---------------
try {
/*@@@@@@*/ echo("[global] -- causing a Fatal Error...");
$nonObjVar->method(); //###### "nonObjVar" isn't defined
}
catch(Exception $error) {
/*@@@@@@*/ echo("[global] -- some handling being executed...");
//###### some handling...
}
/*@@@@@@*/ echo("[global] -- [end]");
Expected result:
----------------
The output would be the following:
# [global] -- causing a Fatal Error...
# [global] -- some handling being executed...
# [global] -- [end]
Actual result:
--------------
Obviously, the output with the current implementation is the
following:
# [global] -- causing a Fatal Error...
# ( PHP Notice ) undefined Variable: nonObjVar
# ( PHP Fatal Error ) call to member a Funcion ( "method()" ) on a
non-Object
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40014&edit=1