Bug #79810 [Opn->Nab]: BC break in parse_url in PHP 8.0.0-dev
| From: | nikic@php.net | Date: | Wed, 08 Jul 2020 15:11:00 +0000 |
| Subject: | Bug #79810 [Opn->Nab]: BC break in parse_url in PHP 8.0.0-dev | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-227892@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79810&edit=1
ID: 79810
Updated by: nikic@php.net
Reported by: wouter at madewithlove dot be
Summary: BC break in parse_url in PHP 8.0.0-dev
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: ubuntu
PHP Version: 8.0.0alpha1
Block user comment: N
Private report: N
New Comment:
This is an intentional change and documented in the upgrading notes: https://github.com/php/php-src/blob/06da048622c46b8322ef651c9dae2ffd68161842/UPGRADING#L430.
Previous Comments:
------------------------------------------------------------------------
[2020-07-08 15:06:53] 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) ""
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79810&edit=1