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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
44 + 26 = ?
Subscribe to this entry?

 
 [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: Sun Aug 01 18:01:25 2021 UTC