# The Uri\WhatWg\Url class

(PHP 8 >= 8.5.0)

## Introduction

## Class synopsis

namespace Uri\WhatWg;
final readonly class Url {
/* Methods */
public Uri\WhatWg\Url::__construct(string `$uri`, ?Uri\WhatWg\Url `$baseUrl` = `null`, array `&$softErrors` = `null`)
public Uri\WhatWg\Url::__debugInfo(): array
public Uri\WhatWg\Url::equals(Uri\WhatWg\Url `$url`, Uri\UriComparisonMode `$comparisonMode` = `Uri\UriComparisonMode::ExcludeFragment`): bool
public Uri\WhatWg\Url::getAsciiHost(): ?string
public Uri\WhatWg\Url::getFragment(): ?string
public Uri\WhatWg\Url::getPassword(): ?string
public Uri\WhatWg\Url::getPath(): string
public Uri\WhatWg\Url::getPort(): ?int
public Uri\WhatWg\Url::getQuery(): ?string
public Uri\WhatWg\Url::getScheme(): string
public Uri\WhatWg\Url::getUnicodeHost(): ?string
public Uri\WhatWg\Url::getUsername(): ?string
public static Uri\WhatWg\Url::parse(string `$uri`, ?Uri\WhatWg\Url `$baseUrl` = `null`, array `&$errors` = `null`): ?static
public Uri\WhatWg\Url::resolve(string `$uri`, array `&$softErrors` = `null`): static
public Uri\WhatWg\Url::__serialize(): array
public Uri\WhatWg\Url::toAsciiString(): string
public Uri\WhatWg\Url::toUnicodeString(): string
public Uri\WhatWg\Url::__unserialize(array `$data`): void
public Uri\WhatWg\Url::withFragment(?string `$fragment`): static
public Uri\WhatWg\Url::withHost(?string `$host`): static
public Uri\WhatWg\Url::withPassword(#[\SensitiveParameter] ?string `$password`): static
public Uri\WhatWg\Url::withPath(string `$path`): static
public Uri\WhatWg\Url::withPort(?int `$port`): static
public Uri\WhatWg\Url::withQuery(?string `$query`): static
public Uri\WhatWg\Url::withScheme(string `$scheme`): static
public Uri\WhatWg\Url::withUsername(?string `$username`): static
}

## Table of Contents

- Uri\WhatWg\Url::__construct — Construct the Url object
- Uri\WhatWg\Url::__debugInfo — Return the internal state of the URL
- Uri\WhatWg\Url::equals — Check if two URLs are equivalent
- Uri\WhatWg\Url::getAsciiHost — Retrieve the host component as an ASCII string
- Uri\WhatWg\Url::getFragment — Retrieve the fragment component
- Uri\WhatWg\Url::getPassword — Retrieve the password component
- Uri\WhatWg\Url::getPath — Retrieve the path component
- Uri\WhatWg\Url::getPort — Retrieve the port component
- Uri\WhatWg\Url::getQuery — Retrieve the query component
- Uri\WhatWg\Url::getScheme — Retrieve the scheme component
- Uri\WhatWg\Url::getUnicodeHost — Retrieve the host component as an Unicode string
- Uri\WhatWg\Url::getUsername — Retrieve the username component
- Uri\WhatWg\Url::parse — Parse a URL
- Uri\WhatWg\Url::resolve — Resolve a URL with the current object as the base URL
- Uri\WhatWg\Url::__serialize — Serialize the Url object
- Uri\WhatWg\Url::toAsciiString — Recompose the URL as an ASCII string
- Uri\WhatWg\Url::toUnicodeString — Recompose the URL as a Unicode string
- Uri\WhatWg\Url::__unserialize — Deserialize the data parameter into a Url object
- Uri\WhatWg\Url::withFragment — Modify the fragment component
- Uri\WhatWg\Url::withHost — Modify the host component
- Uri\WhatWg\Url::withPassword — Modify the password component
- Uri\WhatWg\Url::withPath — Modify the path component
- Uri\WhatWg\Url::withPort — Modify the port component
- Uri\WhatWg\Url::withQuery — Modify the query component
- Uri\WhatWg\Url::withScheme — Modify the scheme component
- Uri\WhatWg\Url::withUsername — Modify the username component

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