|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-12-19 09:51 UTC] dinhbaouit at gmail dot com
Description:
------------
In PHP <7.2.26 when using parse_url "host:port?query" the result return incorrect
Test script:
---------------
<?php
var_dump(parse_url("localhost:80?a=1"));
?>
Expected result:
----------------
php > var_dump(parse_url("localhost:80?a=1"));
array(3) {
["host"]=>
string(9) "localhost"
["port"]=>
string(2) "80"
["query"]=>
string(3) "a=1"
}
Actual result:
--------------
php > var_dump(parse_url("localhost:80?a=1"));
array(3) {
["scheme"]=>
string(9) "localhost"
["path"]=>
string(2) "80"
["query"]=>
string(3) "a=1"
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 22:00:01 2025 UTC |
Hi folk, i did the same test with FQDN and... Test script: --------------- <?php var_dump(parse_url('http://localhost:80?a=1')); ?> Result: ---------------- array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(9) "localhost" ["port"]=> int(80) ["query"]=> string(3) "a=1" } This result is expected .