Skip to content

Instantly share code, notes, and snippets.

@Radon8472
Created January 8, 2020 13:36
Show Gist options
  • Save Radon8472/fecaeead1ad733fe44e335b110302589 to your computer and use it in GitHub Desktop.
Save Radon8472/fecaeead1ad733fe44e335b110302589 to your computer and use it in GitHub Desktop.
<?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