3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $usernumber = 18; $myseries = range(0, 59, 5); foreach($myseries as $num) { echo $num.'<br />'; $check = round($usernumber/5) * 5; echo "<br>".$check."--"; //if($usernumber is close to $num) { // echo 'Matching number is '.$num; //} }
Output for 5.0.0 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
0<br /><br>20--5<br /><br>20--10<br /><br>20--15<br /><br>20--20<br /><br>20--25<br /><br>20--30<br /><br>20--35<br /><br>20--40<br /><br>20--45<br /><br>20--50<br /><br>20--55<br /><br>20--
Output for 4.3.0 - 4.3.10, 4.4.0 - 4.4.9
Warning: Wrong parameter count for range() in /in/gSmfS on line 4 Warning: Invalid argument supplied for foreach() in /in/gSmfS on line 5
Output for 4.3.11
Warning: Wrong parameter count for range() in /in/gSmfS on line 4