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 = (array) $a; $n = '3'; var_dump($b); var_dump($b[$n]);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [3]=> object(stdClass)#1 (2) { ["friend"]=> int(45) ["all"]=> int(100) } [2]=> object(stdClass)#3 (2) { ["friend"]=> int(30) ["all"]=> int(50) } [1]=> object(stdClass)#4 (2) { ["friend"]=> int(25) ["all"]=> int(25) } } 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:
33.19 ms | 401 KiB | 8 Q