php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79810 BC break in parse_url in PHP 8.0.0-dev
Submitted: 2020-07-08 15:06 UTC Modified: 2020-07-08 15:11 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: wouter at madewithlove dot be Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 8.0.0alpha1 OS: ubuntu
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: wouter at madewithlove dot be
New email:
PHP Version: OS:

 

 [2020-07-08 15:06 UTC] wouter at madewithlove dot be
Description:
------------
When running parse_url on an url ending in `?` (such as https://example.com?), parse_url behaves differently in PHP8.0.0 than it did in PHP 7.x. It now adds a `query` array key containing an empty string, which wasn't the case previously.

Test script:
---------------
var_dump(parse_url('https://example.com?'));

see: https://3v4l.org/etR9T

Expected result:
----------------
array(2) {
  ["scheme"]=>
  string(5) "https"
  ["host"]=>
  string(11) "example.com"
}

The result should be the same as in PHP7.x

Actual result:
--------------
array(3) {
  ["scheme"]=>
  string(5) "https"
  ["host"]=>
  string(11) "example.com"
  ["query"]=>
  string(0) ""
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-08 15:11 UTC] nikic@php.net
-Status: Open +Status: Not a bug
 [2020-07-08 15:11 UTC] nikic@php.net
This is an intentional change and documented in the upgrading notes: https://github.com/php/php-src/blob/06da048622c46b8322ef651c9dae2ffd68161842/UPGRADING#L430.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Aug 16 12:05:45 2022 UTC