php8.5
Home/ Manual/ rfc3986 / uri/ Uri\Rfc3986\Uri::__construct

Uri\Rfc3986\Uri::__construct

PHP function Edit on GitHub ✎

(PHP 8 >= 8.5.0)

Construct the Uri object

Description

Uri\Rfc3986\Uri::__construct(string $uri, Uri\Rfc3986\Uri|null $baseUrl = null)

Constructs the Uri\Rfc3986\Uri object.

Parameters

uri

URI to parse.

baseUrl

When a String is passed, uri is applied on baseUrl, if uri is a relative reference. If either null is passed, or uri is a not a relative reference, then baseUrl doesn't have any effect.

Errors/Exceptions InvalidUriException

See Also

  • Uri\Rfc3986\Uri::parse
  • Uri\Rfc3986\Uri::resolve
  • Uri\WhatWg\Url::__construct

Source: reference/uri/uri/rfc3986/uri/construct.xml · from the official PHP manual (php/doc-en)