3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "first=value&arr[]=foo+bar&arr[]=baz"; parse_str($str); echo $first; // value echo $arr[0]; // foo bar echo $arr[1]; // baz
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 ArgumentCountError: parse_str() expects exactly 2 arguments, 1 given in /in/CR6Lb:3 Stack trace: #0 /in/CR6Lb(3): parse_str('first=value&arr...') #1 {main} thrown in /in/CR6Lb on line 3
Process exited with code 255.
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Deprecated: parse_str(): Calling parse_str() without the result argument is deprecated in /in/CR6Lb on line 3 valuefoo barbaz
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
valuefoo barbaz

preferences:
227.34 ms | 402 KiB | 385 Q