env()->is_debug) { register_shutdown_function(array(self::class, 'checkErrors')); } } public static function checkErrors() { $error = error_get_last(); // Nothing, happy us. if (is_null($error)) { return; } elseif (1 !== $error['type']) // Nothing fatal. { return; } else { ob_clean(); // try to scrub other stuff echo '
' . $error['message'] .  ' in ' . $error['file']  . ' on line ' . $error['line'] . '
Last Item ID: ' . OptimizeController::getLastId() . '
'; exit('
-ShortPixel Error Handler-
'); } } }