src/Debug/ErrorLevel.php
public static function getConstants($phpVer = null)
    {
        $phpVer = $phpVer ?: PHP_VERSION;
        /*
            version_compare considers 1 < 1.0 < 1.0.0
        */
        $phpVer = \preg_match('/^\d+\.\d+$/', $phpVer)
            ? $phpVer.'.0'
            : $phpVer;
        $constants = array(
            'E_ERROR' => 1,
            'E_WARNING' => 2,
            'E_PARSE' => 4,
            'E_NOTICE' => 8,
            '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_STRICT' => \version_compare($phpVer, '5.0.0', '>=') ? 2048 : null,
            'E_RECOVERABLE_ERROR' => \version_compare($phpVer, '5.2.0', '>=') ? 4096 : null,
            'E_DEPRECATED' => \version_compare($phpVer, '5.3.0', '>=') ? 8192 : null,
            'E_USER_DEPRECATED' => \version_compare($phpVer, '5.3.0', '>=') ? 16384 : null,
            'E_ALL' => null, // calculated below
        );
        $constants = \array_filter($constants);
        /*
            E_ALL value:
            >= 5.4: 32767
               5.3: 30719 (doesn't include E_STRICT)
               5.2: 6143 (doesn't include E_STRICT)
             < 5.2: 2047 (doesn't include E_STRICT)
        */
        $constants['E_ALL'] = \array_sum($constants);
        if (isset($constants['E_STRICT']) && \version_compare($phpVer, '5.4.0', '<')) {
            // E_STRICT not included in E_ALL until 5.4
            $constants['E_ALL'] -= $constants['E_STRICT'];
        }
        return $constants;
    }
public static function getConstants($phpVer = null)
    {
        $phpVer = $phpVer ?: PHP_VERSION;
        /*
            version_compare considers 1 < 1.0 < 1.0.0
        */
        $phpVer = \preg_match('/^\d+\.\d+$/', $phpVer)
            ? $phpVer.'.0'
            : $phpVer;
        $constants = array(
            'E_ERROR' => 1,
            'E_WARNING' => 2,
            'E_PARSE' => 4,
            'E_NOTICE' => 8,
            '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_STRICT' => \version_compare($phpVer, '5.0.0', '>=') ? 2048 : null,
            'E_RECOVERABLE_ERROR' => \version_compare($phpVer, '5.2.0', '>=') ? 4096 : null,
            'E_DEPRECATED' => \version_compare($phpVer, '5.3.0', '>=') ? 8192 : null,
            'E_USER_DEPRECATED' => \version_compare($phpVer, '5.3.0', '>=') ? 16384 : null,
            'E_ALL' => null, // calculated below
        );
        $constants = \array_filter($constants);
        /*
            E_ALL value:
            >= 5.4: 32767
               5.3: 30719 (doesn't include E_STRICT)
               5.2: 6143 (doesn't include E_STRICT)
             < 5.2: 2047 (doesn't include E_STRICT)
        */
        $constants['E_ALL'] = \array_sum($constants);
        if (isset($constants['E_STRICT']) && \version_compare($phpVer, '5.4.0', '<')) {
            // E_STRICT not included in E_ALL until 5.4
            $constants['E_ALL'] -= $constants['E_STRICT'];
        }
        return $constants;
    }
public static function getConstants ( $ phpVer = null ) { $ phpVer = $ phpVer ? : PHP_VERSION ; /*
            version_compare considers 1 < 1.0 < 1.0.0
        */ $ phpVer = \ preg_match ( '/^\d+\.\d+$/' , $ phpVer ) ? $ phpVer . '.0' : $ phpVer ; $ constants = array ( 'E_ERROR' => 1 , 'E_WARNING' => 2 , 'E_PARSE' => 4 , 'E_NOTICE' => 8 , '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_STRICT' => \ version_compare ( $ phpVer , '5.0.0' , '>=' ) ? 2048 : null , 'E_RECOVERABLE_ERROR' => \ version_compare ( $ phpVer , '5.2.0' , '>=' ) ? 4096 : null , 'E_DEPRECATED' => \ version_compare ( $ phpVer , '5.3.0' , '>=' ) ? 8192 : null , 'E_USER_DEPRECATED' => \ version_compare ( $ phpVer , '5.3.0' , '>=' ) ? 16384 : null , 'E_ALL' => null , // calculated below ) ; $ constants = \ array_filter ( $ constants ) ; /*
            E_ALL value:
            >= 5.4: 32767
               5.3: 30719 (doesn't include E_STRICT)
               5.2: 6143 (doesn't include E_STRICT)
             < 5.2: 2047 (doesn't include E_STRICT)
        */ $ constants [ 'E_ALL' ] = \ array_sum ( $ constants ) ; if ( isset ( $ constants [ 'E_STRICT' ] ) && \ version_compare ( $ phpVer , '5.4.0' , '<' ) ) { // E_STRICT not included in E_ALL until 5.4 $ constants [ 'E_ALL' ] -= $ constants [ 'E_STRICT' ] ; } return $ constants ; }
Get error level constants understood by specified php version

@param string $phpVer (PHP_VERSION) PHP verion

@return array
Get error level constants understood by specified php version