I just found this line:
set_error_handler(create_function(‘$x, $y’, ‘throw new Exception($y, $x);’), E_ALL~E_NOTICE);
in the comments on php.net and did a short test to see whether it works. Normally I used to have a global function which passes all the errors through a logging-chain (FILE/MAIL/DISPLAY) but having exceptions could be more comfortable because you might sometimes want to make decisions locally and not on a global scope and just setting and re-setting the error-handler is not the best idea for this… I’m not sure if I get used to it, because the error-handling function did a good job for the last years … we’ll see :)
...
Read more