mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Fix #80431: parse_url() return fragment, query while there is not
This commit is contained in:
parent
e95ae8d94c
commit
0254e633d2
1 changed files with 40 additions and 0 deletions
|
@ -118,6 +118,23 @@
|
|||
<type>int</type>, in the case of <constant>PHP_URL_PORT</constant>)
|
||||
instead of an <type>array</type>. If the requested component doesn't exist
|
||||
within the given URL, &null; will be returned.
|
||||
As of PHP 8.0.0, <function>parse_url</function> distinguishes absent and empty
|
||||
queries and fragments:
|
||||
</para>
|
||||
<para>
|
||||
<informalexample>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
http://example.com/foo → query = null, fragment = null
|
||||
http://example.com/foo? → query = "", fragment = null
|
||||
http://example.com/foo# → query = null, fragment = ""
|
||||
http://example.com/foo?# → query = "", fragment = ""
|
||||
]]>
|
||||
</screen>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
Previously all cases resulted in query and fragment being &null;.
|
||||
</para>
|
||||
<para>
|
||||
Note that control characters (cf. <function>ctype_cntrl</function>) in the
|
||||
|
@ -125,6 +142,29 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>8.0.0</entry>
|
||||
<entry>
|
||||
<function>parse_url</function> will now distinguish absent and empty queries
|
||||
and fragments.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
|
|
Loading…
Reference in a new issue