Skip to content

Instantly share code, notes, and snippets.

@whatthejeff
Created May 15, 2013 06:51
Show Gist options
  • Save whatthejeff/5582074 to your computer and use it in GitHub Desktop.
Save whatthejeff/5582074 to your computer and use it in GitHub Desktop.
PHP's error constants
<?php
$errors = [
'E_ERROR',
'E_WARNING',
'E_PARSE',
'E_NOTICE',
'E_CORE_ERROR',
'E_CORE_WARNING',
'E_COMPILE_ERROR',
'E_COMPILE_WARNING',
'E_USER_ERROR',
'E_USER_WARNING',
'E_USER_NOTICE',
'E_STRICT',
'E_RECOVERABLE_ERROR',
'E_DEPRECATED',
'E_USER_DEPRECATED',
'E_ALL',
];
foreach($errors as $error) {
printf("%'015b - %s\n", constant($error), $error);
}
000000000000001 - E_ERROR
000000000000010 - E_WARNING
000000000000100 - E_PARSE
000000000001000 - E_NOTICE
000000000010000 - E_CORE_ERROR
000000000100000 - E_CORE_WARNING
000000001000000 - E_COMPILE_ERROR
000000010000000 - E_COMPILE_WARNING
000000100000000 - E_USER_ERROR
000001000000000 - E_USER_WARNING
000010000000000 - E_USER_NOTICE
000100000000000 - E_STRICT
001000000000000 - E_RECOVERABLE_ERROR
010000000000000 - E_DEPRECATED
100000000000000 - E_USER_DEPRECATED
111011111111111 - E_ALL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment