3v4l.org

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