3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php do{ $a = mt_rand(5, 75); $b = mt_rand(5, 75); $adjuster = mt_rand(2, 20); $decimal_selector = mt_rand(1, 6); if ($decimal_selector == 1){ $a = $a / 10; $b = $b / 10; } if ($decimal_selector == 2){ $a = $a / 10; $b = $b / 100; } if ($decimal_selector == 3){ $a = $a / 100; $b = $b / 10; } if ($decimal_selector == 4){ $a = $a / 100; $b = $b / 100; } if ($decimal_selector == 5){ $a = $a / 1000; $b = $b / 1000; } if ($decimal_selector == 6){ $a = $a / 1000; $b = $b / 100; } if($b < $a){ $b = $b + ($a - $b) + $adjuster; } $c = $b - $a; if(intval($c) == $c) { $c_is_int = 1; echo "c $c is int\n"; } else { $c_is_int = 0; "c $c is NOT int\n"; } } while($c_is_int == 1);
Output for 5.2.7, 7.1.0
c 14 is int
Output for 4.3.1 - 4.3.2, 4.3.6, 4.3.9 - 4.4.1, 4.4.3 - 4.4.6, 4.4.8 - 5.0.0, 5.0.2 - 5.0.3, 5.0.5, 5.1.1, 5.1.3 - 5.2.0, 5.2.2, 5.2.4 - 5.2.6, 5.2.8 - 5.2.9, 5.2.12 - 5.2.16, 5.3.1 - 5.3.2, 5.3.5 - 5.3.9, 5.3.11, 5.3.15, 5.3.17, 5.3.19, 5.3.21, 5.3.23 - 5.3.25, 5.3.28 - 5.4.5, 5.4.7 - 5.4.10, 5.4.14, 5.4.16 - 5.4.19, 5.4.21 - 5.4.26, 5.4.28, 5.4.30 - 5.4.31, 5.4.34 - 5.4.35, 5.4.38 - 5.4.45, 5.5.25, 5.5.29 - 5.5.33, 5.6.9, 5.6.12 - 5.6.13, 5.6.18 - 5.6.20, 5.6.28, 7.0.1 - 7.0.3, 7.0.5, 7.0.14
Output for 7.0.12
c 19 is int c 12 is int
Output for 5.6.8, 7.0.6
c 11 is int
Output for 5.3.0, 5.4.20, 5.4.27, 7.0.4
c 17 is int
Output for 4.4.2, 5.2.10, 5.5.26, 5.6.10, 7.0.0
c 12 is int
Output for hhvm-3.12.0
c 13 is int
Output for hhvm-3.10.0
c 0 is int c 19 is int
Output for 5.6.21
c 2 is int c 13 is int c 19 is int
Output for 5.4.11, 5.4.37, 5.6.17
c 9 is int
Output for 5.6.16
c 11 is int c 19 is int c 6 is int
Output for 5.6.15
c 11 is int c 18 is int
Output for 5.3.22, 5.6.14
c 16 is int
Output for 4.3.0, 5.6.11
c 6 is int
Output for 5.5.35
c 15 is int c 15 is int c 10 is int c 6 is int
Output for 5.5.34
c 0 is int
Output for 4.3.8, 5.5.28
c 10 is int
Output for 5.3.3 - 5.3.4, 5.4.36, 5.5.27
c 15 is int
Output for 5.5.24
c 4 is int c 9 is int
Output for 5.4.32
c 19 is int
Output for 5.4.29
c 16 is int c 4 is int
Output for 5.4.15
c 18 is int c 2 is int
Output for 5.2.3, 5.4.13
c 3 is int
Output for 5.3.13, 5.4.12
c 2 is int
Output for 5.4.6
c 5 is int
Output for 5.3.27
c 18 is int c 6 is int
Output for 5.3.26
c 2 is int c 18 is int
Output for 5.3.20
c 8 is int c 18 is int
Output for 5.3.18
c 10 is int c 5 is int
Output for 5.3.16
c 2 is int c 4 is int
Output for 5.3.14
c 19 is int c 3 is int c 16 is int
Output for 5.3.12
c 15 is int c 19 is int
Output for 4.3.3, 5.2.17, 5.3.10
c 4 is int
Output for 5.2.11
c 1 is int
Output for 5.2.1
c 20 is int
Output for 5.1.2
c 4 is int c 19 is int
Output for 5.1.0
c 12 is int c 18 is int c 5 is int
Output for 5.0.4
c 17 is int c 20 is int
Output for 5.0.1
c 6 is int c 18 is int c 7 is int
Output for 4.4.7
c 2 is int c 17 is int
Output for 4.3.7
c 8 is int c 10 is int
Output for 4.3.5
c 14 is int c 12 is int c 15 is int
Output for 4.3.4
c 13 is int c 9 is int c 11 is int