lib/Uri.php
public function withHost($host)
    {
        $url = clone $this;
        $url->host = $host;

        $url->hash = null;

        return $url;
    }
public function withHost($host)
    {
        $url = clone $this;
        $url->host = $host;

        $url->hash = null;

        return $url;
    }
public function withHost ( $ host ) { $ url = clone $ this ; $ url -> host = $ host ; $ url -> hash = null ; return $ url ; }
Create a new instance with the specified host.

This method MUST retain the state of the current instance, and return
a new instance that contains the specified host.

An empty host value is equivalent to removing the host.

@param string $host Hostname to use with the new instance.
@return self A new instance with the specified host.
@throws \InvalidArgumentException for invalid hostnames.
Create a new instance with the specified host .