From:             public at syranide dot com
Operating system: 
PHP version:      5.2.2
PHP Bug Type:     Feature/Change Request
Bug description:  Mechanism for trapping fatal errors

Description:
------------
Something I've been longing to see is a way to catch fatal errors so that
PHP doesn't print out errors to the clients or worse, nothing at all.
Obviously this isn't possible as the engine might be in an unstable state
and it would be unsafe to continue.

But I figure if the internals of PHP can handle it, would it not be
possible to upon fatal errors run a pre-defined script filename (settable
via iniset/putenv as well) using a new instance of the engine with the
error available (perhaps the backtrace as well) in $_SERVER or wherever? So
that you could apply your own error logging and output.

So instead of:
runscript IF fatalerror THEN printfatal END
You would get something like:
runscript IF fatalerror THEN runhandler IF fatalerror THEN printfatal END
END

This would be a blessing for both custom debugging functionality, giving
clients useful errors and being able to log these actions using custom
utilities (most people don't have access or log php errors in the
http-log). As in fact, the common fatal errors are that you have called a
non-existant function, worked on a bad object or put in a bad character and
not the engine going rogue.


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

Reply via email to