Description
The following code:
<?php
print_r(parse_url('https://test.com/a/b/c:354/'));
print_r(parse_url('test.com/a/b/c:354/'));
print_r(parse_url('/a/b/c:354/'));
Resulted in this output:
Array
(
[scheme] => https
[host] => test.com
[path] => /a/b/c:354/
)
Array
(
[host] => test.com
[port] => 354
[path] => /a/b/c:354/
)
But I expected this output instead:
Array
(
[scheme] => https
[host] => test.com
[path] => /a/b/c:354/
)
Array
(
[host] => test.com
[path] => /a/b/c:354/
)
Array
(
[path] => /a/b/c:354/
)
PHP Version
PHP 8.4.4
Operating System
No response