3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(parse_url('//foo.com'), parse_url('//foo.com:80'));
Output for 5.5.24 - 5.5.38, 5.6.8 - 5.6.28, 7.0.0 - 7.1.0
array(1) { ["host"]=> string(7) "foo.com" } array(2) { ["host"]=> string(7) "foo.com" ["port"]=> int(80) }
Output for 5.4.7 - 5.5.23, 5.6.0 - 5.6.7, hhvm-3.10.0 - 3.13.2
array(1) { ["host"]=> string(7) "foo.com" } bool(false)
Output for 5.3.3 - 5.4.6
array(1) { ["path"]=> string(9) "//foo.com" } bool(false)
Output for 5.2.0 - 5.3.2
Warning: parse_url(//foo.com:80): Unable to parse URL in /in/b02G4 on line 3 array(1) { ["path"]=> string(9) "//foo.com" } bool(false)
Output for 4.3.2 - 5.1.6
Warning: parse_url(//foo.com:80): Unable to parse url in /in/b02G4 on line 3 array(1) { ["path"]=> string(9) "//foo.com" } bool(false)
Output for 4.3.0 - 4.3.1
array(1) { ["path"]=> string(9) "//foo.com" } array(2) { ["host"]=> string(9) "//foo.com" ["port"]=> int(80) }