3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = '{ "1": { "name": "test", "followup": { "1": { "id": "98", "followup": { "1": { "id": "93", "followup": { "1": { "id": "174" } } } } } } } }'; $ids = array(); $data = json_decode($str, true); array_walk_recursive($data, function($v, $k) use (&$ids) { if ($k === 'id') { $ids[] = $v; } }); var_dump($ids);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> string(2) "98" [1]=> string(2) "93" [2]=> string(3) "174" }

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:
56.06 ms | 1950 KiB | 4 Q