lib/Uri.php
public function withQuery($query)
    {
        $url = clone $this;
        $url->query = $query;
        $url->hash = null;

        return $url;
    }
public function withQuery($query)
    {
        $url = clone $this;
        $url->query = $query;
        $url->hash = null;

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

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

If the query string is prefixed by "?", that character MUST be removed.
Additionally, the query string SHOULD be parseable by parse_str() in
order to be valid.

An empty query string value is equivalent to removing the query string.

@param string $query The query string to use with the new instance.
@return self A new instance with the specified query string.
@throws \InvalidArgumentException for invalid query strings.
Create a new instance with the specified query string .