3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "original example:\n"; $t = 35; $jsonobj = '{"ABC":35,"DEF":36,"GEH":34}'; $obj = json_decode($jsonobj); $match =[]; foreach($obj as $key => $value){ if ($t <= $value) { $match[] = $key . " => " . $value; } } if(count($match) > 0){ echo implode("<br>\n", $match); }else{ echo "no matches"; } echo "\n\n\nexample of all is false:\n"; // If all is false example: $t = 40; $jsonobj = '{"ABC":35,"DEF":36,"GEH":34}'; $obj = json_decode($jsonobj); $match =[]; foreach($obj as $key => $value){ if ($t <= $value) { $match[] = $key . " => " . $value; } } if(count($match) > 0){ echo implode("<br>\n", $match); }else{ echo "no matches"; }
Output for git.master, git.master_jit, rfc.property-hooks
original example: ABC => 35<br> DEF => 36 example of all is false: no matches

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