By using get_defined_constants function from php, I can see all the defined constants by system and myself.
Example:
<?php
define("MY_CONSTANT", 1);
print_r(get_defined_constants(true));
?>
Output:
Array
(
[Core] => Array
(
[E_ERROR] => 1
[E_RECOVERABLE_ERROR] => 4096
[E_WARNING] => 2
[E_PARSE] => 4
[E_NOTICE] => 8
[E_STRICT] => 2048
[E_DEPRECATED] => 8192
[E_CORE_ERROR] => 16
[E_CORE_WARNING] => 32
[E_COMPILE_ERROR] => 64
[E_COMPILE_WARNING] => 128
[E_USER_ERROR] => 256
[E_USER_WARNING] => 512
[E_USER_NOTICE] => 1024
[E_USER_DEPRECATED] => 16384
[E_ALL] => 30719
[DEBUG_BACKTRACE_PROVIDE_OBJECT] => 1
[DEBUG_BACKTRACE_IGNORE_ARGS] => 2
....
Question: How did they come up with the integer value to some constants? For example E_ALL has a value of 30719. Why 30719 and not a random number?
E_ALLis a effectively a mask. Its decimal value is totally meaningless; what's important is the value of each bit by itself. See php.net/manual/en/errorfunc.constants.php