3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php header('Content-type: text/plain'); $url = 'http://user:pass@www.example.com'; $rel = '/?query=string#fragment'; var_dump(parse_url($rel), parse_url($url . $rel));
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(3) { ["path"]=> string(1) "/" ["query"]=> string(12) "query=string" ["fragment"]=> string(8) "fragment" } array(7) { ["scheme"]=> string(4) "http" ["host"]=> string(15) "www.example.com" ["user"]=> string(4) "user" ["pass"]=> string(4) "pass" ["path"]=> string(1) "/" ["query"]=> string(12) "query=string" ["fragment"]=> string(8) "fragment" }