3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getColor($number) { $color = array("black", "lightblue", "gray", "green", "pink", "blueviolet", "red", "blue", "lightgreen", "brown"); if ($number == 100) { return $color[9]; } else if ($number == 0) { return $color[0]; } else if ($number % 10 == 0) { print(3); $value = $number / 10; return $color[$value--]; } else { $value = $number / 10; return $color[floor($value)]; } } print(getColor(30));
based on 1k1WA
Output for 4.3.0 - 7.2.6
3green