Level 47
You can use set_error_handler. http://php.net/manual/en/function.set-error-handler.php
Dont forget to restore the error handler with restore_error_handler.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Can I avoid that Laravel send Exceptions to some types of errors like PHP WARNING? This kind of error don't prevents PHP to handle the right request, it's just a warning, I need to LOG it but not redirect to a 500 error page.
Can I intercept some types of exceptions to avoid it?
Please or to participate in this conversation.