public function replacePath($newUrl, $opt = self::PATH | self::QUERY | self::FRAGMENT)
	{
		if ($newUrl instanceof Url) {
			$url = $newUrl;
		} else if ($newUrl instanceof Path) {
			$url = new Url();
			$url->path->set($newUrl);
		} else if (is_string($newUrl)) {
			$url = new Url($newUrl);
		} else {
			throw new InvalidUrlException();
		}
		$path = ($opt & self::PATH) === self::PATH;
		$query = ($opt & self::QUERY) === self::QUERY;
		$fragment = ($opt & self::FRAGMENT) === self::FRAGMENT;
		if ($path) {
			$this->path->set($url->path->get());
		}
		if ($query) {
			$this->query->parseComponent($url->query->__toString());
		}
		if ($fragment) {
			$this->fragment->set($url->fragment->get());
		}
		return $this;
	}