3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $requestedUri = $_SERVER['REQUEST_URI'] = 'http://www.testing.com/login'; $requestedUriWithQuery = $_SERVER['REQUEST_URI'] = 'http://www.testing.com/login?name=name&password=password'; print_r([ parse_url($requestedUri), parse_url($requestedUriWithQuery), parse_str($requestedUriWithQuery["query"]) ]);
based on WYuO2
Output for 7.2.0
Warning: Illegal string offset 'query' in /in/gcEbb on line 7 Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /in/gcEbb on line 7 Array ( [0] => Array ( [scheme] => http [host] => www.testing.com [path] => /login ) [1] => Array ( [scheme] => http [host] => www.testing.com [path] => /login [query] => name=name&password=password ) [2] => )
Output for 5.4.11 - 7.1.10
Warning: Illegal string offset 'query' in /in/gcEbb on line 7 Array ( [0] => Array ( [scheme] => http [host] => www.testing.com [path] => /login ) [1] => Array ( [scheme] => http [host] => www.testing.com [path] => /login [query] => name=name&password=password ) [2] => )
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/gcEbb on line 4
Process exited with code 255.