php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80431 parse_url() return fragment, query while there is not.
Submitted: 2020-11-27 08:06 UTC Modified: 2020-11-27 08:11 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: kawewong at gmail dot com Assigned:
Status: Verified Package: URL related
PHP Version: 8.0.0 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kawewong at gmail dot com
New email:
PHP Version: OS:

 

 [2020-11-27 08:06 UTC] 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' => '',
);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-27 08:11 UTC] requinix@php.net
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem
 [2020-11-27 08:11 UTC] requinix@php.net
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.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Mar 03 22:01:25 2021 UTC