3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getCat($val) { $cat = ''; if ($val >= 81) { $cat = 'A'; } else if ($val >= 71 && $val <= 80) { $cat = 'AB'; } else if ($val >= 51 && $val <= 70) { $cat = 'B'; } else { $cat = $val < 40 ? 'C' : 'BC'; } return $cat; } echo getCat(90) . PHP_EOL; echo getCat(72) . PHP_EOL; echo getCat(55) . PHP_EOL; echo getCat(45) . PHP_EOL; echo getCat(10) . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
A AB B BC C

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