PHP error_reporting Boolean Values

Print Friendly

The PHP page is really not that useful, and only talks about using the PHP Contstants E_ALL, E_NOTICE, E_STRICT etc

This information is not obvious on the PHP site, so I’m just putting it here as an aid to my brain cells. This is for PHP 5.2.x

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_NOTICE = 8
E_PARSE = 4
E_WARNING = 2
E_ERROR = 1

E_ALL = 6143 = 1011111111111

Therefore E_ALL & ~E_NOTICE = 6143 – 8 = 6135

And to kill warnings as well:

E_ALL & ~E_NOTICE & ~E_WARNING = 6143 – 8- 2 = 6133

Tags:

One Response to “PHP error_reporting Boolean Values”

  1. PRUSS February 1, 2014 at 11:10 am #

    Check this as values are extened
    http://www.php.net/manual/en/errorfunc.constants.php

Leave a Reply

Bot test *