3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function custom_parse_url($url) { if (version_compare(phpversion(), '7.0.0beta1') < 0) { return parse_url('test://'.$url); } else { return parse_url($url); } } $url = "_search?q=sku:89399"; var_dump(custom_parse_url($url));
based on hkkTo
Output for 7.0.0 - 7.2.0
array(2) { ["path"]=> string(7) "_search" ["query"]=> string(11) "q=sku:89399" }
Output for 5.3.20 - 5.6.28
array(3) { ["scheme"]=> string(4) "test" ["host"]=> string(7) "_search" ["query"]=> string(11) "q=sku:89399" }