Created
September 24, 2014 10:20
-
-
Save hamsterbacke23/de8fdb11bf8cde102d55 to your computer and use it in GitHub Desktop.
Display current error report level
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 | |
function error_level_tostring($intval, $separator) | |
{ | |
$errorlevels = array( | |
E_ALL => 'E_ALL', | |
E_USER_DEPRECATED => 'E_USER_DEPRECATED', | |
E_DEPRECATED => 'E_DEPRECATED', | |
E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', | |
E_STRICT => 'E_STRICT', | |
E_USER_NOTICE => 'E_USER_NOTICE', | |
E_USER_WARNING => 'E_USER_WARNING', | |
E_USER_ERROR => 'E_USER_ERROR', | |
E_COMPILE_WARNING => 'E_COMPILE_WARNING', | |
E_COMPILE_ERROR => 'E_COMPILE_ERROR', | |
E_CORE_WARNING => 'E_CORE_WARNING', | |
E_CORE_ERROR => 'E_CORE_ERROR', | |
E_NOTICE => 'E_NOTICE', | |
E_PARSE => 'E_PARSE', | |
E_WARNING => 'E_WARNING', | |
E_ERROR => 'E_ERROR'); | |
$result = ''; | |
foreach($errorlevels as $number => $name) | |
{ | |
if (($intval & $number) == $number) { | |
$result .= ($result != '' ? $separator : '').$name; | |
} | |
} | |
return $result; | |
} | |
ini_set('display_errors',1); | |
echo error_level_tostring(error_reporting(), '<br>'); | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment