3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url = '//host.example.com'; var_dump( parse_url( $url ) ); $url = '//[::FFFF::127.0.0.1]'; var_dump( parse_url( $url ) );
based on XZ9Na
Output for 5.4.8 - 7.2.6
array(1) { ["host"]=> string(16) "host.example.com" } array(1) { ["host"]=> string(19) "[::FFFF::127.0.0.1]" }
Output for 5.4.7
array(1) { ["host"]=> string(16) "host.example.com" } array(1) { ["path"]=> string(21) "//[::FFFF::127.0.0.1]" }
Output for 4.4.0 - 4.4.9, 5.0.5 - 5.4.6
array(1) { ["path"]=> string(18) "//host.example.com" } array(1) { ["path"]=> string(21) "//[::FFFF::127.0.0.1]" }
Output for 4.3.0 - 4.3.11, 5.0.0 - 5.0.4
array(1) { ["path"]=> string(18) "//host.example.com" } array(2) { ["scheme"]=> string(3) "//[" ["path"]=> string(17) ":FFFF::127.0.0.1]" }