Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Numeric values of error reporting levels

Tags:

php

I'm checking the configuration of my PHP server and I need to set the following parameter as follows:

error_reporting set to E_ALL & ~E_NOTICE

However on my server a numeric value is set:

error_reporting 6135 6135

I was wondering what's the meaning of it, and if I really need to change it

thanks

like image 682
aneuryzm Avatar asked Sep 21 '10 08:09

aneuryzm


People also ask

What is the meaning of E_error and E_warning?

E_ERROR. 1. A fatal run-time error, that can't be recovered from. The execution of the script is stopped immediately. E_WARNING.

What is a PHP warning?

PHP Warning: Include This warning tells you that an include file (included using PHP's include syntax) was not found. It is a warning rather than an error, because PHP will continue trying to load the page if it cannot find an include. In PHP, you can include files using include() or require() .


2 Answers

foreach(
    array('E_ALL', 'E_NOTICE', '~E_NOTICE', 'E_ALL&~E_NOTICE') 
    as $s) {
    eval("\$v=$s;");
    printf("%20s = dec %10u = bin %32b\n", $s, $v, $v);
}

result

           E_ALL = dec       6143 = bin                    1011111111111
        E_NOTICE = dec          8 = bin                             1000
       ~E_NOTICE = dec 4294967287 = bin 11111111111111111111111111110111
 E_ALL&~E_NOTICE = dec       6135 = bin                    1011111110111
like image 179
user187291 Avatar answered Oct 07 '22 01:10

user187291


Values used for error reporting

 E_RECOVERABLE_ERROR  4096 +
E_USER_NOTICE        1024 +
E_USER_WARNING        512 +
E_USER_ERROR          256 +
E_COMPILE_WARNING     128 +
E_COMPILE_ERROR        64 +
E_CORE_WARNING         32 +
E_CORE_ERROR           16 +
E_PARSE                 4 +
E_WARNING               2 +
E_ERROR                 1 +
                   = 6135
like image 40
Mark Baker Avatar answered Oct 07 '22 01:10

Mark Baker