3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Example difference between PHP version compared to 8.4's new technique".PHP_EOL; echo "===================".PHP_EOL; echo round(33.324999999999996,2) . PHP_EOL; echo round(33.334999999999996,2) . PHP_EOL; echo round(33.344999999999996,2) . PHP_EOL; echo round(33.354999999999996,2) . PHP_EOL; echo round(33.364999999999996,2) . PHP_EOL; echo round(33.374999999999996,2) . PHP_EOL; echo round(33.384999999999996,2) . PHP_EOL; echo round(33.394999999999996,2) . PHP_EOL; echo PHP_EOL; echo " simple multiplication " . 25*1.333 .PHP_EOL; echo " rounding that same sum " . round((25*1.333),2) . PHP_EOL; echo " but wait, lets just round 33.325 => " . round(33.325,2) . PHP_EOL;

preferences:
25.07 ms | 404 KiB | 5 Q