[doc-en] master: `Uri` Fix classname and extra `e.g.`, amend examples, describe normalization (#5548)

From: Date: Tue, 15 Sep 2026 08:26:30 +0000
Subject: [doc-en] master: `Uri` Fix classname and extra `e.g.`, amend examples, describe normalization (#5548)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23755@lists.php.net to get a copy of this message
Author: Mikhail Alferov (mmalferov) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-09-15T10:26:27+02:00 Commit: https://github.com/php/doc-en/commit/9bf8b904f30d04adcccd3e202c9e870b79284789 Raw diff: https://github.com/php/doc-en/commit/9bf8b904f30d04adcccd3e202c9e870b79284789.diff Uri Fix classname and extra e.g., amend examples, describe normalization (#5548) * construct.xml Fix classname and extra e.g. * getasciihost.xml Add more relevant non-ASCII URL for example * parse.xml Remove extra e.g and add missing ; in the example And is the return type ?static accurate and not ?self or literally ?Uri\WhatWg\Url, and doesn't it confuse the reader, since the class is final? * toasciistring.xml Give an URL relevant for the example * tounicodestring.xml Show how method works * unserialize.xml Let's deserialize the array, not the parameter * getfragment.xml Show how the method works * getfragment.xml Clarify fragment normalization * language-snippets.ent Add the URI normalization snippet * getfragment.xml Replace a literal sentence with a variable * gethost.xml Clarify normalization * getfragment.xml Move the normalization description to a simpara * gethost.xml Move the normalization description to a simpara * gethost.xml Show an example of normalization * getpassword.xml Add normalization description * getpath.xml Mention normalization mechanism * getpath.xml Show how the method works * getport.xml Remove the mention of normalization ```PHP_METHOD(Uri_Rfc3986_Uri, getPort) { php_uri_property_read_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_URI_PROPERTY_NAME_PORT, PHP_URI_COMPONENT_READ_MODE_RAW); }``` Judging by the source code, the port component, unlike the password or the host components, is not normalized. It seems that the mention of normalization was included in the description by mistake :) ```PHP_METHOD(Uri_Rfc3986_Uri, getPassword) { php_uri_property_read_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_URI_PROPERTY_NAME_PASSWORD, PHP_URI_COMPONENT_READ_MODE_NORMALIZED_ASCII); }``` * getquery.xml Add the normalization description + show how the method works * language-snippets.ent Add the non-normalization snippet * getrawfragment.xml Add the non-normalization desc * getrawfragment.xml Show how the method works * getrawhost.xml Describe non-normalization + show how the method works * Update getrawhost.xml * getrawpassword.xml Describe non-normalization + show how the method works * getrawpath.xml Describe non-normalization + show how the method works * getrawquery.xml Describe non-serialization + show how the method works * getrawscheme.xml Describe non-normalization + show how the method works * getrawuserinfo.xml Describe non-normalization + amend the example * getrawpassword.xml Remove the mention of... ...an non-normalized in the return section for consistency with other methods * getrawusername.xml Describe non-normalization * getscheme.xml Describe normalization + show how the method works * getuserinfo.xml Describe normalization + show how the method works * getusername.xml Describe normalization + show how the method works * Update language-snippets.ent * Update parse.xml Add missed ; * resolve.xml The method works not only with URLs * torawstring.xml Describe non-normalization + show how the method works * tostring.xml Describe normalization + show how to method works * Update withfragment.xml Add <?php tag * uri.whatwg.urlvalidationerrortype.xml Add missing desc * Keep the shared getter examples out of this pull request The example rewrites in the RFC 3986 getter pages overlap with #5471, which unifies the example URL across all of them; reverting them here leaves the two pull requests disjoint. The normalization entities and the wording changes stay. Also corrects four points in what is left: - the normalization entity omitted dot segment removal, which is what getPath() visibly does - the non-normalization entity claimed components are returned in their original form, which toRawString() and a resolved getRawPath() both contradict - getPort() does normalize, it drops leading zeros, so the page keeps its wording - Ipv4InIpv6InvalidCodePoint is also raised for an empty part, a leading zero and too many parts, not only for an invalid code point * Correct the normalization wording and the relative URL examples The non-normalization entity said "No normalization is applied", which toRawString() contradicts for an IPv6 host: the host is recomposed from its parsed form, so [2001:DB8::1] comes back fully expanded and in lowercase even when the input was already compressed. Drop the absolute claim, keep the four clauses that do hold, add the dot segment mirror of the other entity, and state the IPv6 exception on the toRawString() page itself. Uri\WhatWg\Url::__construct() and ::parse() gave /foo as an example of "a valid URL string", but both reject it without a baseUrl (MissingSchemeNonRelativeUrl). Say so instead. Uri\WhatWg\Url::resolve() does accept it, and only needed the duplicated "(e.g." removed, which is the third occurrence of the one this pull request already fixed. * Use the manual's usual IDN label in the Url examples The three pages need a non-ASCII host, since getAsciiHost(), toAsciiString() and toUnicodeString() only differ from getHost() and toString() on an internationalized domain name; with a plain example.com they printed back their own input. The label itself does not have to be an eighteen letter compound though: the manual already uses "täst" for this on the intl idn pages, which keeps the punycode short enough to read in a screen block. --------- Co-authored-by: lacatoire <la.catoire@gmail.com> Changed paths: M language-snippets.ent M reference/uri/uri.whatwg.urlvalidationerrortype.xml M reference/uri/uri/rfc3986/uri/getfragment.xml M reference/uri/uri/rfc3986/uri/gethost.xml M reference/uri/uri/rfc3986/uri/getpassword.xml M reference/uri/uri/rfc3986/uri/getpath.xml M reference/uri/uri/rfc3986/uri/getquery.xml M reference/uri/uri/rfc3986/uri/getrawfragment.xml M reference/uri/uri/rfc3986/uri/getrawhost.xml M reference/uri/uri/rfc3986/uri/getrawpassword.xml M reference/uri/uri/rfc3986/uri/getrawpath.xml M reference/uri/uri/rfc3986/uri/getrawquery.xml M reference/uri/uri/rfc3986/uri/getrawscheme.xml M reference/uri/uri/rfc3986/uri/getrawuserinfo.xml M reference/uri/uri/rfc3986/uri/getrawusername.xml M reference/uri/uri/rfc3986/uri/getscheme.xml M reference/uri/uri/rfc3986/uri/getuserinfo.xml M reference/uri/uri/rfc3986/uri/getusername.xml M reference/uri/uri/rfc3986/uri/parse.xml M reference/uri/uri/rfc3986/uri/resolve.xml M reference/uri/uri/rfc3986/uri/torawstring.xml M reference/uri/uri/rfc3986/uri/tostring.xml M reference/uri/uri/rfc3986/uri/withfragment.xml M reference/uri/uri/whatwg/url/construct.xml M reference/uri/uri/whatwg/url/getasciihost.xml M reference/uri/uri/whatwg/url/parse.xml M reference/uri/uri/whatwg/url/resolve.xml M reference/uri/uri/whatwg/url/toasciistring.xml M reference/uri/uri/whatwg/url/tounicodestring.xml M reference/uri/uri/whatwg/url/unserialize.xml Diff: diff --git a/language-snippets.ent b/language-snippets.ent index d98bb6831217..c678ce86b01c 100644 --- a/language-snippets.ent +++ b/language-snippets.ent @@ -4436,6 +4436,18 @@ local: { </simpara> '> +<!ENTITY uri.normalization ' + <simpara> + Hexadecimal triplets are converted to uppercase, percent-encoded unreserved characters are decoded, the scheme and host components are normalized to lowercase, and dot segments are removed from the path, per RFC 3986. + </simpara> +'> + +<!ENTITY uri.non-normalization ' + <simpara> + Hexadecimal triplets are not converted to uppercase, percent-encoded unreserved characters remain encoded, the scheme and host components keep the case they were given in, and dot segments are kept in the path. + </simpara> +'> + <!-- UOPZ snippets --> <!ENTITY uopz.warn.removed.function-5-0-0 '<warning diff --git a/reference/uri/uri.whatwg.urlvalidationerrortype.xml b/reference/uri/uri.whatwg.urlvalidationerrortype.xml index f2e58f029701..cf4b6efb923d 100644 --- a/reference/uri/uri.whatwg.urlvalidationerrortype.xml +++ b/reference/uri/uri.whatwg.urlvalidationerrortype.xml @@ -105,7 +105,7 @@ <enumitem> <enumidentifier>Ipv4InIpv6InvalidCodePoint</enumidentifier> - <enumitemdescription>An IPv6 address with IPv4 address syntax.</enumitemdescription> + <enumitemdescription>An IPv6 address with IPv4 address syntax: an IPv4 part is empty, contains a non-ASCII digit or a leading zero, or there are too many IPv4 parts.</enumitemdescription> </enumitem> <enumitem> diff --git a/reference/uri/uri/rfc3986/uri/getfragment.xml b/reference/uri/uri/rfc3986/uri/getfragment.xml index 0fecabee30e8..d003dd298cd6 100644 --- a/reference/uri/uri/rfc3986/uri/getfragment.xml +++ b/reference/uri/uri/rfc3986/uri/getfragment.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the normalized fragment component. </simpara> + &uri.normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/gethost.xml b/reference/uri/uri/rfc3986/uri/gethost.xml index 4a033e4bfea9..c26fa1e8d622 100644 --- a/reference/uri/uri/rfc3986/uri/gethost.xml +++ b/reference/uri/uri/rfc3986/uri/gethost.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the normalized host component. </simpara> + &uri.normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getpassword.xml b/reference/uri/uri/rfc3986/uri/getpassword.xml index a5a6d271745f..1a0ff8b8fff7 100644 --- a/reference/uri/uri/rfc3986/uri/getpassword.xml +++ b/reference/uri/uri/rfc3986/uri/getpassword.xml @@ -15,6 +15,7 @@ Retrieves the normalized password part (the text after the first <literal>:</literal> character) from the userinfo component. </simpara> + &uri.normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getpath.xml b/reference/uri/uri/rfc3986/uri/getpath.xml index e302667ff34f..45e2a648afaa 100644 --- a/reference/uri/uri/rfc3986/uri/getpath.xml +++ b/reference/uri/uri/rfc3986/uri/getpath.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the normalized path component. </simpara> + &uri.normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getquery.xml b/reference/uri/uri/rfc3986/uri/getquery.xml index 2ae16d783772..bceb5e2a3f53 100644 --- a/reference/uri/uri/rfc3986/uri/getquery.xml +++ b/reference/uri/uri/rfc3986/uri/getquery.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the normalized query component. </simpara> + &uri.normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getrawfragment.xml b/reference/uri/uri/rfc3986/uri/getrawfragment.xml index f2e6256bfc3d..0b9bcc227691 100644 --- a/reference/uri/uri/rfc3986/uri/getrawfragment.xml +++ b/reference/uri/uri/rfc3986/uri/getrawfragment.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the raw (non-normalized) fragment component. </simpara> + &uri.non-normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getrawhost.xml b/reference/uri/uri/rfc3986/uri/getrawhost.xml index 66798f2af8e8..2852bbf90e4e 100644 --- a/reference/uri/uri/rfc3986/uri/getrawhost.xml +++ b/reference/uri/uri/rfc3986/uri/getrawhost.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the raw (non-normalized) host component. </simpara> + &uri.non-normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getrawpassword.xml b/reference/uri/uri/rfc3986/uri/getrawpassword.xml index cbf4a8367347..6f45012ebda9 100644 --- a/reference/uri/uri/rfc3986/uri/getrawpassword.xml +++ b/reference/uri/uri/rfc3986/uri/getrawpassword.xml @@ -15,6 +15,7 @@ Retrieves the raw (non-normalized) password part (the text after the first <literal>:</literal> character) from the userinfo component. </simpara> + &uri.non-normalization; </refsect1> <refsect1 role="parameters"> @@ -25,7 +26,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <simpara> - Returns the raw (non-normalized) password as a &string; if the userinfo component contains a <literal>:</literal> character. + Returns the raw password as a &string; if the userinfo component contains a <literal>:</literal> character. An empty string is returned when the userinfo component doesn't contain a <literal>:</literal> character. &null; is returned when the userinfo component doesn't exist. </simpara> diff --git a/reference/uri/uri/rfc3986/uri/getrawpath.xml b/reference/uri/uri/rfc3986/uri/getrawpath.xml index 82779af66927..5fe29ab47648 100644 --- a/reference/uri/uri/rfc3986/uri/getrawpath.xml +++ b/reference/uri/uri/rfc3986/uri/getrawpath.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the raw (non-normalized) path component. </simpara> + &uri.non-normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getrawquery.xml b/reference/uri/uri/rfc3986/uri/getrawquery.xml index 7b0323f79f27..b796dee89b1c 100644 --- a/reference/uri/uri/rfc3986/uri/getrawquery.xml +++ b/reference/uri/uri/rfc3986/uri/getrawquery.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the raw (non-normalized) query component. </simpara> + &uri.non-normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getrawscheme.xml b/reference/uri/uri/rfc3986/uri/getrawscheme.xml index ff6130f94537..d31517f9de42 100644 --- a/reference/uri/uri/rfc3986/uri/getrawscheme.xml +++ b/reference/uri/uri/rfc3986/uri/getrawscheme.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the raw (non-normalized) scheme component. </simpara> + &uri.non-normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getrawuserinfo.xml b/reference/uri/uri/rfc3986/uri/getrawuserinfo.xml index 57a32f30a165..1db52105a740 100644 --- a/reference/uri/uri/rfc3986/uri/getrawuserinfo.xml +++ b/reference/uri/uri/rfc3986/uri/getrawuserinfo.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the raw (non-normalized) userinfo component. </simpara> + &uri.non-normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getrawusername.xml b/reference/uri/uri/rfc3986/uri/getrawusername.xml index 5dff1a6903af..b827cc3b30a2 100644 --- a/reference/uri/uri/rfc3986/uri/getrawusername.xml +++ b/reference/uri/uri/rfc3986/uri/getrawusername.xml @@ -15,6 +15,7 @@ Retrieves the raw (non-normalized) username part (the text before the first <literal>:</literal> character) from userinfo component. </simpara> + &uri.non-normalization; </refsect1> <refsect1 role="parameters"> @@ -25,7 +26,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <simpara> - Returns the raw (non-normalized) username as a &string; if the userinfo component exists, &null; is returned otherwise. + Returns the raw username as a &string; if the userinfo component exists, &null; is returned otherwise. </simpara> </refsect1> diff --git a/reference/uri/uri/rfc3986/uri/getscheme.xml b/reference/uri/uri/rfc3986/uri/getscheme.xml index 81ad886924a7..fd1d1b0f9e52 100644 --- a/reference/uri/uri/rfc3986/uri/getscheme.xml +++ b/reference/uri/uri/rfc3986/uri/getscheme.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the normalized scheme component. </simpara> + &uri.normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getuserinfo.xml b/reference/uri/uri/rfc3986/uri/getuserinfo.xml index cd8cf4b9975e..00a7005d655c 100644 --- a/reference/uri/uri/rfc3986/uri/getuserinfo.xml +++ b/reference/uri/uri/rfc3986/uri/getuserinfo.xml @@ -14,6 +14,7 @@ <simpara> Retrieves the normalized userinfo component. </simpara> + &uri.normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/getusername.xml b/reference/uri/uri/rfc3986/uri/getusername.xml index 717753632e8b..ec0afc3ed419 100644 --- a/reference/uri/uri/rfc3986/uri/getusername.xml +++ b/reference/uri/uri/rfc3986/uri/getusername.xml @@ -15,6 +15,7 @@ Retrieves the normalized username part (the text before the first <literal>:</literal> character) from the userinfo component. </simpara> + &uri.normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/parse.xml b/reference/uri/uri/rfc3986/uri/parse.xml index ee962da2b3de..80e68a4070a8 100644 --- a/reference/uri/uri/rfc3986/uri/parse.xml +++ b/reference/uri/uri/rfc3986/uri/parse.xml @@ -56,6 +56,7 @@ <programlisting role="php"> <![CDATA[ <?php + $uri = \Uri\Rfc3986\Uri::parse("https://example.com"); if ($uri !== null) { @@ -63,7 +64,6 @@ if ($uri !== null) { } else { echo "Invalid URI"; } -?> ]]> </programlisting> &example.outputs; diff --git a/reference/uri/uri/rfc3986/uri/resolve.xml b/reference/uri/uri/rfc3986/uri/resolve.xml index 68f162ba0ee2..4e028cf14294 100644 --- a/reference/uri/uri/rfc3986/uri/resolve.xml +++ b/reference/uri/uri/rfc3986/uri/resolve.xml @@ -2,7 +2,7 @@ <refentry xml:id="uri-rfc3986-uri.resolve" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>Uri\Rfc3986\Uri::resolve</refname> - <refpurpose>Resolve a URI with the current object as the base URL</refpurpose> + <refpurpose>Resolve a URI with the current object as the base URI</refpurpose> </refnamediv> <refsect1 role="description"> @@ -12,7 +12,7 @@ <methodparam><type>string</type><parameter>uri</parameter></methodparam> </methodsynopsis> <simpara> - Resolves a URI - which may potentially be a relative reference - with the current object as the base URL. + Resolves a URI - which may potentially be a relative reference - with the current object as the base URI. </simpara> </refsect1> @@ -49,11 +49,11 @@ <programlisting role="php"> <![CDATA[ <?php + $uri = new \Uri\Rfc3986\Uri("https://example.com"); $uri = $uri->resolve("/foo"); echo $uri->toRawString(); -?> ]]> </programlisting> &example.outputs; diff --git a/reference/uri/uri/rfc3986/uri/torawstring.xml b/reference/uri/uri/rfc3986/uri/torawstring.xml index b8ccbe91d6d2..1bf68c3841b1 100644 --- a/reference/uri/uri/rfc3986/uri/torawstring.xml +++ b/reference/uri/uri/rfc3986/uri/torawstring.xml @@ -14,6 +14,12 @@ <simpara> Recomposes the raw (non-normalized) URI to a &string;. </simpara> + &uri.non-normalization; + <simpara> + An IPv6 host is an exception: it is recomposed from its parsed form, and is + therefore returned fully expanded and in lowercase, whatever notation the + input used. + </simpara> </refsect1> <refsect1 role="parameters"> @@ -24,7 +30,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <simpara> - Returns the recomposed raw (non-normalized) URI as a &string;. + Returns the recomposed raw URI as a &string;. </simpara> </refsect1> diff --git a/reference/uri/uri/rfc3986/uri/tostring.xml b/reference/uri/uri/rfc3986/uri/tostring.xml index 713d44c50181..b7cdc1938530 100644 --- a/reference/uri/uri/rfc3986/uri/tostring.xml +++ b/reference/uri/uri/rfc3986/uri/tostring.xml @@ -14,6 +14,7 @@ <simpara> Recomposes the normalized URI to a &string;. </simpara> + &uri.normalization; </refsect1> <refsect1 role="parameters"> diff --git a/reference/uri/uri/rfc3986/uri/withfragment.xml b/reference/uri/uri/rfc3986/uri/withfragment.xml index a8760f6926fc..b0345bb362df 100644 --- a/reference/uri/uri/rfc3986/uri/withfragment.xml +++ b/reference/uri/uri/rfc3986/uri/withfragment.xml @@ -49,11 +49,11 @@ <programlisting role="php"> <![CDATA[ <?php + $uri = new \Uri\Rfc3986\Uri("https://example.com/#foo"); $uri = $uri->withFragment("bar"); echo $uri->getFragment(); -?> ]]> </programlisting> &example.outputs; diff --git a/reference/uri/uri/whatwg/url/construct.xml b/reference/uri/uri/whatwg/url/construct.xml index 3eb638ca6930..baf904aa8e4d 100644 --- a/reference/uri/uri/whatwg/url/construct.xml +++ b/reference/uri/uri/whatwg/url/construct.xml @@ -14,7 +14,7 @@ <methodparam choice="opt"><type>array</type><parameter role="reference">softErrors</parameter><initializer>&null;</initializer></methodparam> </constructorsynopsis> <simpara> - Constructs the <classname>Uri\Rfc3986\Uri</classname> object. + Constructs the <classname>Uri\WhatWg\Url</classname> object. </simpara> </refsect1> @@ -25,7 +25,10 @@ <term><parameter>uri</parameter></term> <listitem> <simpara> - A valid URL string to parse (e.g. <literal>/foo</literal> or (e.g. <literal>https://example.com/foo</literal>). + A URL string to parse, for instance + <literal>https://example.com/foo</literal>. A relative-URL string such as + <literal>/foo</literal> is only accepted when + <parameter>baseUrl</parameter> is given. </simpara> </listitem> </varlistentry> diff --git a/reference/uri/uri/whatwg/url/getasciihost.xml b/reference/uri/uri/whatwg/url/getasciihost.xml index 0f239f583868..7fb29b7a28b5 100644 --- a/reference/uri/uri/whatwg/url/getasciihost.xml +++ b/reference/uri/uri/whatwg/url/getasciihost.xml @@ -35,16 +35,16 @@ <programlisting role="php"> <![CDATA[ <?php -$url = new \Uri\WhatWg\Url("https://example.com"); + +$url = new \Uri\WhatWg\Url("https://täst.example.com"); echo $url->getAsciiHost(); -?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ -example.com +xn--tst-qla.example.com ]]> </screen> </example> diff --git a/reference/uri/uri/whatwg/url/parse.xml b/reference/uri/uri/whatwg/url/parse.xml index a14cb5ebf7a8..9578ade6ff55 100644 --- a/reference/uri/uri/whatwg/url/parse.xml +++ b/reference/uri/uri/whatwg/url/parse.xml @@ -25,7 +25,10 @@ <term><parameter>uri</parameter></term> <listitem> <simpara> - A valid URL string to parse (e.g. <literal>/foo</literal> or (e.g. <literal>https://example.com/foo</literal>). + A URL string to parse, for instance + <literal>https://example.com/foo</literal>. A relative-URL string such as + <literal>/foo</literal> is only accepted when + <parameter>baseUrl</parameter> is given. </simpara> </listitem> </varlistentry> @@ -66,6 +69,7 @@ <programlisting role="php"> <![CDATA[ <?php + $url = \Uri\WhatWg\Url::parse("https://example.com"); if ($url !== null) { @@ -73,7 +77,6 @@ if ($url !== null) { } else { echo "Invalid URL"; } -?> ]]> </programlisting> &example.outputs; diff --git a/reference/uri/uri/whatwg/url/resolve.xml b/reference/uri/uri/whatwg/url/resolve.xml index 4132ecd7a782..d0a68f4d71fb 100644 --- a/reference/uri/uri/whatwg/url/resolve.xml +++ b/reference/uri/uri/whatwg/url/resolve.xml @@ -24,7 +24,7 @@ <term><parameter>uri</parameter></term> <listitem> <simpara> - A valid URL string (e.g. <literal>/foo</literal> or (e.g. <literal>https://example.com/foo</literal>) to apply on + A valid URL string (e.g. <literal>/foo</literal> or <literal>https://example.com/foo</literal>) to apply on the current object. </simpara> </listitem> diff --git a/reference/uri/uri/whatwg/url/toasciistring.xml b/reference/uri/uri/whatwg/url/toasciistring.xml index f53c6f5b2016..e25d35e44a9b 100644 --- a/reference/uri/uri/whatwg/url/toasciistring.xml +++ b/reference/uri/uri/whatwg/url/toasciistring.xml @@ -36,16 +36,16 @@ <programlisting role="php"> <![CDATA[ <?php -$url = new \Uri\WhatWg\Url("https://example.com/foo/bar?baz"); + +$url = new \Uri\WhatWg\Url("https://täst.example.com/foo/bar?baz"); echo $url->toAsciiString(); -?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ -https://example.com/foo/bar?baz +https://xn--tst-qla.example.com/foo/bar?baz ]]> </screen> </example> diff --git a/reference/uri/uri/whatwg/url/tounicodestring.xml b/reference/uri/uri/whatwg/url/tounicodestring.xml index c45b34fd134a..1d5b24a6f22d 100644 --- a/reference/uri/uri/whatwg/url/tounicodestring.xml +++ b/reference/uri/uri/whatwg/url/tounicodestring.xml @@ -35,16 +35,16 @@ <programlisting role="php"> <![CDATA[ <?php -$url = new \Uri\WhatWg\Url("https://example.com/foo/bar?baz"); + +$url = new \Uri\WhatWg\Url("https://xn--tst-qla.example.com/foo/bar?baz"); echo $url->toUnicodeString(); -?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ -https://example.com/foo/bar?baz +https://täst.example.com/foo/bar?baz ]]> </screen> </example> diff --git a/reference/uri/uri/whatwg/url/unserialize.xml b/reference/uri/uri/whatwg/url/unserialize.xml index 0a18cacb8718..2f6b3286eba1 100644 --- a/reference/uri/uri/whatwg/url/unserialize.xml +++ b/reference/uri/uri/whatwg/url/unserialize.xml @@ -2,7 +2,7 @@ <refentry xml:id="uri-whatwg-url.unserialize" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>Uri\WhatWg\Url::__unserialize</refname> - <refpurpose>Deserialize the data parameter into a Url object</refpurpose> + <refpurpose>Deserialize the array from the data parameter into a Url object</refpurpose> </refnamediv> <refsect1 role="description"> @@ -12,7 +12,7 @@ <methodparam><type>array</type><parameter>data</parameter></methodparam> </methodsynopsis> <simpara> - Deserializes a data parameter into a <classname>Uri\WhatWg\Url</classname> object. + Deserializes the &array; from the <parameter>data</parameter> parameter into a <classname>Uri\WhatWg\Url</classname> object. </simpara> </refsect1>

« previous php.doc.cvs (#23755) next »