1、问题
我自己在 tp5.1的源码的时候,看到 注册错误和异常处理机制的时候,在 error.php 中看到一段代码不是很理解
public static function appError($errno, $errstr, $errfile = '', $errline = 0)
{
$exception = new ErrorException($errno, $errstr, $errfile, $errline); if (error_reporting() & $errno) { // 将错误信息托管至 think\exception\ErrorException
throw $exception;
} self::getExceptionHandler()->report($exception);
}这是error的处理函数,
我对于其中 if (error_reporting() & $errno) 这一段特别不理解。
这个位运算 在这里有什么意义?
HUH函数