3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $json = <<<EOJ { "a": 1, "b": "banana", "c": { "x": 1, "y": 2, "z": [{"id":5},{"id":6},{"id":7}] } } EOJ; $arr = json_decode($json); foreach ($arr->c->z as $o) { echo $o->id, ', '; }
Output for 5.2.15 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
5, 6, 7,