Created
January 8, 2020 13:36
-
-
Save Radon8472/fecaeead1ad733fe44e335b110302589 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* prints the php errorlevel for phpinfo | |
* | |
* @param int [$errorlevel] | |
* | |
* @todo add format option, or implement diffent displays for Commandline and Server (check sapi) | |
*/ | |
function phpinfo_block_errorlevel($errorlevel = null) | |
{ | |
if(is_null($errorlevel)) $errorlevel = error_reporting(); | |
foreach (get_defined_constants(true)["Core"] as $n => $v) { | |
if (strpos($n, "E_") === 0) { | |
printf("%-20s: %s\n",$n, var_export(($errorlevel & $v) ==$v, true)); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment