public function child()
    {
        $child = self::i()->setParent($this);
        
        foreach ($this->globalMiddleware as $callback) {
            $child->add($callback);
        }
        
        foreach ($this->routeMiddleware as $method => $route) {
            $child->route($method, $route[0], $route[1]);
        }
        
        foreach ($this->errorMiddleware as $callback) {
            $child->error($callback);
        }
        
        return $child;
    }