# The Uri\Rfc3986\Uri class

(PHP 8 >= 8.5.0)

## Introduction

## Class synopsis

namespace Uri\Rfc3986;
final readonly class Uri {
/* Methods */
public Uri\Rfc3986\Uri::__construct(string `$uri`, ?Uri\Rfc3986\Uri `$baseUrl` = `null`)
public Uri\Rfc3986\Uri::__debugInfo(): array
public Uri\Rfc3986\Uri::equals(Uri\Rfc3986\Uri `$uri`, Uri\UriComparisonMode `$comparisonMode` = `Uri\UriComparisonMode::ExcludeFragment`): bool
public Uri\Rfc3986\Uri::getFragment(): ?string
public Uri\Rfc3986\Uri::getHost(): ?string
public Uri\Rfc3986\Uri::getPassword(): ?string
public Uri\Rfc3986\Uri::getPath(): string
public Uri\Rfc3986\Uri::getPort(): ?int
public Uri\Rfc3986\Uri::getQuery(): ?string
public Uri\Rfc3986\Uri::getRawFragment(): ?string
public Uri\Rfc3986\Uri::getRawHost(): ?string
public Uri\Rfc3986\Uri::getRawPassword(): ?string
public Uri\Rfc3986\Uri::getRawPath(): string
public Uri\Rfc3986\Uri::getRawQuery(): ?string
public Uri\Rfc3986\Uri::getRawScheme(): ?string
public Uri\Rfc3986\Uri::getRawUserInfo(): ?string
public Uri\Rfc3986\Uri::getRawUsername(): ?string
public Uri\Rfc3986\Uri::getScheme(): ?string
public Uri\Rfc3986\Uri::getUserInfo(): ?string
public Uri\Rfc3986\Uri::getUsername(): ?string
public static Uri\Rfc3986\Uri::parse(string `$uri`, ?Uri\Rfc3986\Uri `$baseUrl` = `null`): ?static
public Uri\Rfc3986\Uri::resolve(string `$uri`): static
public Uri\Rfc3986\Uri::__serialize(): array
public Uri\Rfc3986\Uri::toRawString(): string
public Uri\Rfc3986\Uri::toString(): string
public Uri\Rfc3986\Uri::__unserialize(array `$data`): void
public Uri\Rfc3986\Uri::withFragment(?string `$fragment`): static
public Uri\Rfc3986\Uri::withHost(?string `$host`): static
public Uri\Rfc3986\Uri::withPath(string `$path`): static
public Uri\Rfc3986\Uri::withPort(?int `$port`): static
public Uri\Rfc3986\Uri::withQuery(?string `$query`): static
public Uri\Rfc3986\Uri::withScheme(?string `$scheme`): static
public Uri\Rfc3986\Uri::withUserInfo(#[\SensitiveParameter] ?string `$userinfo`): static
}

## Table of Contents

- Uri\Rfc3986\Uri::__construct — Construct the Uri object
- Uri\Rfc3986\Uri::__debugInfo — Return the internal state of the URI
- Uri\Rfc3986\Uri::equals — Check if two URIs are equivalent
- Uri\Rfc3986\Uri::getFragment — Retrieve the normalized fragment component
- Uri\Rfc3986\Uri::getHost — Retrieve the normalized host component
- Uri\Rfc3986\Uri::getPassword — Retrieve the normalized password
- Uri\Rfc3986\Uri::getPath — Retrieve the normalized path component
- Uri\Rfc3986\Uri::getPort — Retrieve the normalized port component
- Uri\Rfc3986\Uri::getQuery — Retrieve the normalized query component
- Uri\Rfc3986\Uri::getRawFragment — Retrieve the raw fragment component
- Uri\Rfc3986\Uri::getRawHost — Retrieve the raw host component
- Uri\Rfc3986\Uri::getRawPassword — Retrieve the raw password
- Uri\Rfc3986\Uri::getRawPath — Retrieve the raw path component
- Uri\Rfc3986\Uri::getRawQuery — Retrieve the raw query component
- Uri\Rfc3986\Uri::getRawScheme — Retrieve the raw scheme component
- Uri\Rfc3986\Uri::getRawUserInfo — Retrieve the raw userinfo component
- Uri\Rfc3986\Uri::getRawUsername — Retrieve the raw username
- Uri\Rfc3986\Uri::getScheme — Retrieve the normalized scheme component
- Uri\Rfc3986\Uri::getUserInfo — Retrieve the normalized userinfo component
- Uri\Rfc3986\Uri::getUsername — Retrieve the normalized username
- Uri\Rfc3986\Uri::parse — Parse a URI
- Uri\Rfc3986\Uri::resolve — Resolve a URI with the current object as the base URL
- Uri\Rfc3986\Uri::__serialize — Serialize the Uri object
- Uri\Rfc3986\Uri::toRawString — Recompose the raw URI
- Uri\Rfc3986\Uri::toString — Recompose the normalized URI
- Uri\Rfc3986\Uri::__unserialize — Deserialize the data parameter into a Uri object
- Uri\Rfc3986\Uri::withFragment — Modify the fragment component
- Uri\Rfc3986\Uri::withHost — Modify the host component
- Uri\Rfc3986\Uri::withPath — Modify the path component
- Uri\Rfc3986\Uri::withPort — Modify the port component
- Uri\Rfc3986\Uri::withQuery — Modify the query component
- Uri\Rfc3986\Uri::withScheme — Modify the scheme component
- Uri\Rfc3986\Uri::withUserInfo — Modify the userinfo component

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open