3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = array('accounts', 1, 'uid'); $conf = json_decode('{ "accounts": { "1": { "uid": "1" }, "2": { "uid": "16" } }, "online": [ { "rules": { "language": "pl" }, "tag": { "name" : "kraj", "value": "Polska", "save" : true, "delay": 1800 } } ] } ', true); if (!is_array($key)) { $key = array($key); } if (!empty($key)) { $chain = $conf; foreach ($key as $k) { if ($k == ':first:') { $k = array_shift(array_keys($chain)); } if (is_array($chain) && isset($chain[$k])) { $chain = $chain[$k]; } else { return false; } } print_r($chain); } else { print_r($conf); }
Output for git.master, git.master_jit, rfc.property-hooks
1

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