3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); ini_set('display_errors', TRUE); print_r(parse_url('/path/?query')); print_r(parse_url('/path')); print_r(parse_url('?query=string')); print_r(parse_url('?query')); print_r(parse_url('query')); print_r(parse_url('/'));
Output for 4.3.0 - 7.2.0
Array ( [path] => /path/ [query] => query ) Array ( [path] => /path ) Array ( [query] => query=string ) Array ( [query] => query ) Array ( [path] => query ) Array ( [path] => / )