From:             marcus3v at hotmail dot com
Operating system: 
PHP version:      6CVS-2007-01-03 (CVS)
PHP Bug Type:     Feature/Change Request
Bug description:  "try, catch" -- Let's Empower It, Please!!!

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 bug report at http://bugs.php.net/?id=40014&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40014&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40014&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40014&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40014&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40014&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40014&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40014&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40014&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40014&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40014&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40014&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40014&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40014&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40014&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40014&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40014&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40014&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40014&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40014&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40014&r=mysqlcfg

Reply via email to