3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test($input) { $foo = range ('A', 'D'); if ($input >= 0.6 && $input <= 1) { var_dump($foo[(0.999 - $input)*10]); } else { var_dump('F'); } } test(0.7); test(1); test(0.6); test(0.5); test(2);
based on kuCqN
Output for 4.3.0 - 7.2.0
string(1) "C" string(1) "A" string(1) "D" string(1) "F" string(1) "F"