3v4l.org

run code in 300+ PHP versions simultaneously
<?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"]) );
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /in/WYuO2:7 Stack trace: #0 {main} thrown in /in/WYuO2 on line 7
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Warning: Illegal string offset 'query' in /in/WYuO2 on line 7 Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /in/WYuO2 on line 7 Warning: print_r() expects at most 2 parameters, 3 given in /in/WYuO2 on line 7
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.3.32 - 7.3.33
Warning: Illegal string offset 'query' in /in/WYuO2 on line 7 Warning: print_r() expects at most 2 parameters, 3 given in /in/WYuO2 on line 7
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: Illegal string offset 'query' in /in/WYuO2 on line 7 Warning: print_r() expects at most 2 parameters, 3 given in /in/WYuO2 on line 8

preferences:
151.14 ms | 402 KiB | 185 Q