public function errorHandler($errno, $errstr, $errfile, $errline)
    {
        // Only handle errors that match the error reporting level.
        if (!($errno & error_reporting())) { // bitwise operation
            if ($errno & $this->fatalErrors) {
                $this->terminate();
            }
            return true;
        }

        $e = new ErrorException($errstr, 0, $errno, $errfile, $errline);

        if ($this->throwErrorsAsExceptions) {
            throw $e;
        } else {
            $this->exceptionHandler($e);
        }

        // Fatal errors should be fatal
        if ($errno & $this->fatalErrors) {
            $this->terminate();
        }
    }
public function errorHandler($errno, $errstr, $errfile, $errline)
    {
        // Only handle errors that match the error reporting level.
        if (!($errno & error_reporting())) { // bitwise operation
            if ($errno & $this->fatalErrors) {
                $this->terminate();
            }
            return true;
        }

        $e = new ErrorException($errstr, 0, $errno, $errfile, $errline);

        if ($this->throwErrorsAsExceptions) {
            throw $e;
        } else {
            $this->exceptionHandler($e);
        }

        // Fatal errors should be fatal
        if ($errno & $this->fatalErrors) {
            $this->terminate();
        }
    }
public function errorHandler ( $ errno , $ errstr , $ errfile , $ errline ) { // Only handle errors that match the error reporting level. if ( ! ( $ errno & error_reporting ( ) ) ) { // bitwise operation if ( $ errno & $ this -> fatalErrors ) { $ this -> terminate ( ) ; } return true ; } $ e = new ErrorException ( $ errstr , 0 , $ errno , $ errfile , $ errline ) ; if ( $ this -> throwErrorsAsExceptions ) { throw $ e ; } else { $ this -> exceptionHandler ( $ e ) ; } // Fatal errors should be fatal if ( $ errno & $ this -> fatalErrors ) { $ this -> terminate ( ) ; } }
An error handling function for PHP. Follows the protocols laid out
in the documentation for defining an error handler. Variable names
are straight from the PHP documentation.

@param $errno
@param $errstr
@param $errfile
@param $errline

@return bool
@throws \ErrorException
An error handling function for PHP . Follows the protocols laid out in the documentation for defining an error handler . Variable names are straight from the PHP documentation .