3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "timestamp":1526005337995, "data":[ { "_id":"ByWpiEKaM", "data":"N12E00008", "raw":[78,49,50,69,48,48,48,48,56], "timestamp":1525398457512 } ]}'; $arr = json_decode($json, 1); list($project, $sensor, $percentage) = [substr($arr['data'][0]['data'],0,3), (substr($arr['data'][0]['data'],4,1) == 'E' ? 'Moisture':'Temperature'), substr($arr['data'][0]['data'],-2)]; Var_dump($project, $sensor, $percentage);
Output for git.master, git.master_jit, rfc.property-hooks
string(3) "N12" string(11) "Temperature" string(2) "08"

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:
112.75 ms | 405 KiB | 5 Q