public static function catchFatalErrorsEarly() { $error = error_get_last(); if ($error['type'] === E_ERROR || $error['type'] === E_PARSE) { echo nl2br(str_replace(dirname(dirname(__DIR__)), '', $error['message'])); } }