3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * This code should loop through $data, converting null to 0. */ $data = json_decode('{"last":"0.692776960","high":"0.692776960","low":"0.692776960","avg":0.6928,"vol":"0.252273837","vols":{"bid":null,"ask":null}}', true); $new_data = $data; array_walk_recursive($data, function (&$value) { if ($value === null) { $value = 0; } }); var_dump($new_data);
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { ["last"]=> string(11) "0.692776960" ["high"]=> string(11) "0.692776960" ["low"]=> string(11) "0.692776960" ["avg"]=> float(0.6928) ["vol"]=> string(11) "0.252273837" ["vols"]=> array(2) { ["bid"]=> NULL ["ask"]=> NULL } }

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:
45.86 ms | 402 KiB | 8 Q