In my development machine I have error_reporting set to E_ALL | E_STRICT to see all the error messages that happen in my code.
But when I deal with caught Exceptions like:
try {
throw new MyException('Exception message.');
} catch (MyException $e) {
// code that handles the exception but without print anything
}
PHP always shows the error message:
MyException: Exception message in file://path/to/failed/file.php
and after that PHP can’t send new headers.
Do you know some way to avoid autogenerated PHP errors to be shown by raised, but caught, Exceptions with display_errors=On and error_reporting=E_ALL |E_STRICT?
You can set a custom error handler and have that log errors to a file or something like this. Information on this can be found here: http://php.net/manual/en/function.set-error-handler.php