3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = json_decode('{"3":{"friend":45,"all":100},"2":{"friend":30,"all":50},"1":{"friend":25,"all":25}}'); var_dump((array) $a); var_dump($a->3->friend);
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '3' (T_LNUMBER), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/R5B8D on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_LNUMBER, expecting T_STRING or T_VARIABLE or '{' or '$' in /in/R5B8D on line 4
Process exited with code 255.

preferences:
193.93 ms | 1395 KiB | 62 Q