3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump( parse_url( 'example.com' ) ); var_dump( parse_url( 'this' ) ); var_dump( parse_url( 'this/that/' ) ); var_dump( parse_url( '//example.com' ) ); var_dump( parse_url( 'example.com/hey://ho/letsgo/' ) );
based on btMC3
Output for 5.4.7 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(1) { ["path"]=> string(11) "example.com" } array(1) { ["path"]=> string(4) "this" } array(1) { ["path"]=> string(10) "this/that/" } array(1) { ["host"]=> string(11) "example.com" } array(1) { ["path"]=> string(28) "example.com/hey://ho/letsgo/" }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.3.6 - 5.4.6
array(1) { ["path"]=> string(11) "example.com" } array(1) { ["path"]=> string(4) "this" } array(1) { ["path"]=> string(10) "this/that/" } array(1) { ["path"]=> string(13) "//example.com" } array(1) { ["path"]=> string(28) "example.com/hey://ho/letsgo/" }
Output for 4.4.0 - 4.4.9, 5.0.5 - 5.3.5
array(1) { ["path"]=> string(11) "example.com" } array(1) { ["path"]=> string(4) "this" } array(1) { ["path"]=> string(10) "this/that/" } array(1) { ["path"]=> string(13) "//example.com" } array(2) { ["host"]=> string(11) "example.com" ["path"]=> string(17) "/hey://ho/letsgo/" }
Output for 4.3.0 - 4.3.11, 5.0.0 - 5.0.4
array(1) { ["path"]=> string(11) "example.com" } array(1) { ["path"]=> string(4) "this" } array(1) { ["path"]=> string(10) "this/that/" } array(1) { ["path"]=> string(13) "//example.com" } array(3) { ["scheme"]=> string(15) "example.com/hey" ["host"]=> string(2) "ho" ["path"]=> string(8) "/letsgo/" }