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'; $parsedUri_1 = parse_url($requestedUri); $parsedUri_2 = parse_url($requestedUriWithQuery); $parsedUri_3 = parse_str($parsedUri_2['query']); print_r([ $parsedUri_1, $parsedUri_2, $parsedUri_3 ]);
based on 2pPr4
Output for 7.2.0
Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /in/kppm8 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
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/kppm8 on line 9
Process exited with code 255.