ID: 40014 Comment by: bronner dot mike at gmail dot com Reported By: marcus3v at hotmail dot com Status: Open Bug Type: Feature/Change Request PHP Version: 6CVS-2007-01-03 (CVS) New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [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