3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<'TAG' { "data": [ { "record_id": 9, "region": [ { "code_id": 2, "code_name": "CA" }, { "code_id": 3, "code_name": "WY" } ] }, { "record_id": 10, "region": [ { "code_id": 4, "code_name": "CA" }, { "code_id": 5, "code_name": "WY" } ] } ] } TAG; $obj = json_decode($text, false, 512, JSON_THROW_ON_ERROR); foreach($obj->data as $thing ) { foreach($thing->region as $region) { echo $region->code_id . "\n"; } }
Output for git.master, git.master_jit, rfc.property-hooks
2 3 4 5

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:
106.24 ms | 1381 KiB | 5 Q