Doc #80431 [Ver->Csd]: parse_url() return fragment, query while there is not.

[email protected]
Newsgroups php.doc.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=80431&edit=1

 ID:                 80431
 Updated by:         [email protected]
 Reported by:        kawewong at gmail dot com
 Summary:            parse_url() return fragment, query while there is
                     not.
-Status:             Verified
+Status:             Closed
 Type:               Documentation Problem
 Package:            URL related
 Operating System:   Windows
 PHP Version:        8.0.0
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of cmb69
Revision: https://github.com/php/doc-en/commit/0254e633d2a0cf36c3b3a2ba19350019e12d3b4b
Log: Fix #80431: parse_url() return fragment, query while there is not


Previous Comments:
------------------------------------------------------------------------
[2020-11-27 08:11:23] [email protected]

This is a deliberate change.
https://www.php.net/manual/en/migration80.incompatible.php
(search for "parse_url")

However, the function's docs could use a Changelog entry.

------------------------------------------------------------------------
[2020-11-27 08:06:47] kawewong at gmail dot com

Description:
------------
If I enter the URL like this "/path?#"
The `parse_url()` function always return fragment and query array key while previous versions of PHP like 5.x, 7.x doesn't return these value if not exists.

Expected result:
----------------
array(
    'path' => '/path',
);

Actual result:
--------------
array(
    'path' => '/path',
    'query' => '',
    'fragment' => '',
);


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80431&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.