3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $url = 'tcp://example.com:11211?googleguy=googley&test=1&bob=3?'; var_dump(parse_url($url)); $url = 'unix:///var/run/memcached:0?googleguy=googley&test=1&bob=3?'; var_dump(parse_url($url));
based on 82YpO
Output for 5.3.3 - 7.1.0
array(4) { ["scheme"]=> string(3) "tcp" ["host"]=> string(11) "example.com" ["port"]=> int(11211) ["query"]=> string(31) "googleguy=googley&test=1&bob=3?" } bool(false)
Output for 5.2.0 - 5.3.2
array(4) { ["scheme"]=> string(3) "tcp" ["host"]=> string(11) "example.com" ["port"]=> int(11211) ["query"]=> string(31) "googleguy=googley&test=1&bob=3?" } Warning: parse_url(unix:///var/run/memcached:0?googleguy=googley&test=1&bob=3?): Unable to parse URL in /in/eSaVG on line 5 bool(false)
Output for 4.3.2 - 5.1.6
array(4) { ["scheme"]=> string(3) "tcp" ["host"]=> string(11) "example.com" ["port"]=> int(11211) ["query"]=> string(31) "googleguy=googley&test=1&bob=3?" } Warning: parse_url(unix:///var/run/memcached:0?googleguy=googley&test=1&bob=3?): Unable to parse url in /in/eSaVG on line 5 bool(false)
Output for 4.3.0 - 4.3.1
Warning: parse_url(tcp://example.com:11211?googleguy=googley&test=1&bob=3?) [http://www.php.net/function.parse-url]: Unable to parse url in /in/eSaVG on line 3 bool(false) Warning: parse_url(unix:///var/run/memcached:0?googleguy=googley&test=1&bob=3?) [http://www.php.net/function.parse-url]: Unable to parse url in /in/eSaVG on line 5 bool(false)