3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = 0.6/0.1; printf( "%1.36f\n", $a); $b = $a % 5; print "\$a=$a; \$b=$b\n"; # result: # $a=6; $b=0 # One should expect $b = 1 $a = 0.6/0.1; $a = round($a); printf( "%1.36f\n", $a); $b = $a % 5; print "\$a=$a; \$b=$b\n";
Output for 4.3.0 - 7.1.0
5.999999999999999111821580299874767661 $a=6; $b=0 6.000000000000000000000000000000000000 $a=6; $b=1