php8.5
Home/ Manual/ whatwg / url/ Uri\WhatWg\Url::__construct

Uri\WhatWg\Url::__construct

PHP function Edit on GitHub ✎

(PHP 8 >= 8.5.0)

Construct the Url object

Description

Uri\WhatWg\Url::__construct(string $uri, Uri\WhatWg\Url|null $baseUrl = null, array $softErrors = null)

Constructs the Uri\Rfc3986\Uri object.

Parameters

uri

A valid URL string to parse (e.g. /foo or (e.g. https://example.com/foo).

baseUrl

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

softErrors

An Array to pass a list of Uri\WhatWg\UrlValidationError instances by reference to provide extended information about the errors triggered during parsing.

Errors/Exceptions InvalidUrlException

See Also

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

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