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}}'); $b = 3; var_dump($a->$b); /*var_dump($a['3']); var_dump($a["3"]); var_dump($a[(string) 3]);*/
Output for git.master, git.master_jit, rfc.property-hooks
object(stdClass)#1 (2) { ["friend"]=> int(45) ["all"]=> int(100) }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.61 ms | 401 KiB | 8 Q