What Is 22527 in Error_Reporting 22527 of PHPinfo

What is 22527 in error_reporting 22527 of phpinfo

This value is actually bitmap mask, a sum of constants.

So, 22527 is

  16384 E_USER_DEPRECATED
+
4096 E_RECOVERABLE_ERROR
+
etc...

In your case it's E_ALL & ~E_DEPRECATED, it will display every error, except E_DEPRECATED.

PHP versions below 5.4 will also exclude E_STRICT errors (since E_STRICT is not included in E_ALL before that version)

What does the ^ symbol mean (specifically, within error_reporting)

~ means "except" DOCS

In your second example that would mean E_ALL except E_NOTICE and E_STRICT

The ^ is a "flipper":

^ is the xor (bit flipping) operator and would actually turn notices on if they were previously off (in the error level on its left).

global php error reporting - can I include a file to stop errors displaying?

Edit your php.ini file and set:

error_reporting = 32759

If you're using Apache, you can also set it in httpd.conf or a .htaccess file:

php_value error_reporting 32759

The numbers are looked up from: http://php.net/errorfunc.constants

Numeric values of error reporting levels

From the page we have:

  • E_ALL has the value 30719 in PHP
    5.3.x, 6143 in PHP 5.2.x, 2047 previously

  • E_NOTICE has the value 8

Looks like you are using PHP 5.2.x

Now If you do E_ALL & ~E_NOTICE Which is bitwise complement of E_NOTICE followed by bitwise anding with E_ALL we get

6143 & (~8) = 6135

Not getting Deprecated error as expected

E_DEPRECATED is a subset of E_ALL, so if:

  • display_errors is on
  • error_reporting(E_ALL) is in effect
  • session_register is called
  • you are using PHP >= 5.3

then the error should be visible. If it is not, at least one of the above does not hold.



Related Topics



Leave a reply



Submit