3v4l.org

run code in 500+ PHP versions simultaneously
<?php $amount = 7.5; $vat = 9; $result = $amount * ($vat / 100.0); echo "Result = ".$result."\n"; var_dump($result); $rounded = round($result,2); echo "Rounded = ".$rounded."\n";
Output for 8.4.1 - 8.4.28, 8.5.0 - 8.5.13, 8.6.0
Result = 0.675 float(0.6749999999999999) Rounded = 0.67
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.36, 8.3.0 - 8.3.37
Result = 0.675 float(0.6749999999999999) Rounded = 0.68

preferences:
16.26 ms | 1167 KiB | 6 Q