public function errorHandler($type, ...$args)
    {
        if (!(error_reporting() & $type)) {
            // This error code is not included in error_reporting
            return true;
        }
        if (array_key_exists($type, $this->registeredErrorCallbacks)) {
            $callback = $this->registeredErrorCallbacks[$type];
            $reflection = new \ReflectionFunction($callback);
            $reflection->invokeArgs($args);
            return true;
        }
        return false;
    }