Last active
May 3, 2023 21:36
-
-
Save BenMorel/3cb2e2f3bcf0117e168ba68e933affe2 to your computer and use it in GitHub Desktop.
The first lines of any decent PHP quick script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
error_reporting(E_ALL); | |
set_error_handler(function ($severity, $message, $file, $line) { | |
if ((error_reporting() & $severity) === 0) { | |
return false; | |
} | |
throw new ErrorException($message, 0, $severity, $file, $line); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment