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.5.0 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
0<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--5<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--10<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--15<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--20<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--25<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--30<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--35<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--40<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--45<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--50<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--55<br /> Notice: Undefined variable: check in /in/7Kl4L on line 8 <br>--
Output for 5.0.0 - 5.4.45
0<br /><br>--5<br /><br>--10<br /><br>--15<br /><br>--20<br /><br>--25<br /><br>--30<br /><br>--35<br /><br>--40<br /><br>--45<br /><br>--50<br /><br>--55<br /><br>--
Output for 4.3.0 - 4.3.10, 4.4.0 - 4.4.9
<br /> <b>Warning</b>: Wrong parameter count for range() in <b>/in/7Kl4L</b> on line <b>4</b><br /> <br /> <b>Warning</b>: Invalid argument supplied for foreach() in <b>/in/7Kl4L</b> on line <b>5</b><br />
Output for 4.3.11
<br /> <b>Warning</b>: Wrong parameter count for range() in <b>/in/7Kl4L</b> on line <b>4</b><br />