3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = 'data%5B0%5D%5BfirstItem%5D=true&data%5B0%5D%5BsubItem%5D=true&data%5B0%5D%5BsecondItem%5D=true&data%5B0%5D%5BnumItems%5D=1&data%5B0%5D%5Bitems%5D%5B%5D=Apples'; $array = []; parse_str($str, $array); var_dump($array);
Output for 5.4.0 - 7.1.0
array(1) { ["data"]=> array(1) { [0]=> array(5) { ["firstItem"]=> string(4) "true" ["subItem"]=> string(4) "true" ["secondItem"]=> string(4) "true" ["numItems"]=> string(1) "1" ["items"]=> array(1) { [0]=> string(6) "Apples" } } } }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Jqd6U on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/Jqd6U on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/Jqd6U on line 5
Process exited with code 255.