xref: /PHP-7.0/ext/standard/tests/url/bug54180.phpt (revision 5a53a743)
1--TEST--
2Bug #54180 (parse_url() incorrectly parses path when ? in fragment)
3--FILE--
4<?php
5
6var_dump(parse_url("http://example.com/path/script.html?t=1#fragment?data"));
7var_dump(parse_url("http://example.com/path/script.html#fragment?data"));
8
9?>
10--EXPECTF--
11array(5) {
12  ["scheme"]=>
13  string(4) "http"
14  ["host"]=>
15  string(11) "example.com"
16  ["path"]=>
17  string(17) "/path/script.html"
18  ["query"]=>
19  string(3) "t=1"
20  ["fragment"]=>
21  string(13) "fragment?data"
22}
23array(4) {
24  ["scheme"]=>
25  string(4) "http"
26  ["host"]=>
27  string(11) "example.com"
28  ["path"]=>
29  string(17) "/path/script.html"
30  ["fragment"]=>
31  string(13) "fragment?data"
32}
33