3v4l.org

run code in 300+ PHP versions simultaneously
<?php $son = '{ "1":{ "id":"1", "name":"jack" }, "2":{ "id":"2", "name":"john" } }'; $json = json_decode($son); //var_dump($json); var_dump($json->{'1'}); // correct result $index = 1; var_dump($json->$index); // correct result
Output for git.master, git.master_jit, rfc.property-hooks
object(stdClass)#1 (2) { ["id"]=> string(1) "1" ["name"]=> string(4) "jack" } object(stdClass)#1 (2) { ["id"]=> string(1) "1" ["name"]=> string(4) "jack" }

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:
41.75 ms | 401 KiB | 8 Q