This causes all errors to become exciting instances of ErrorException :
set_error_handler(function($errno, $errstr, $errfile, $errline ){ throw new ErrorException($errstr, $errno, 0, $errfile, $errline); });
use it before code that may give errors for instances in the very top corner of your php file or in the general header included
source share