3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $ox = 10; $oy = 10; $x = 10; $y = 15; $sx = ($ox < $x)?($ox==$x?0:1):-1; $sy = ($oy < $y)?($oy==$y?0:1):-1; var_dump($sx,$sy); //Test collisions for each cell along deplacement for($dx = $ox+$sx; $sx*$dx <= $sx*$x; $dx += $sx){ for($dy = $oy+$sy; $sy*$dy <= $sy*$y; $dy += $sy){ var_dump(array($dx,$dy)); } }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
int(-1) int(1)