3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function round_up($val) { return ceil($val * 100) / 100; } $a = 5.4; $b = 48; var_dump($a * $b); var_dump(bcmul($a, $b, 3) * 1); var_dump(round_up($a * $b)); var_dump(round($a * $b, 2, PHP_ROUND_HALF_UP)); var_dump(round_up(bcmul($a, $b, 3))); echo "\n"; $a = 5.4; $b = 48.13; var_dump($a * $b); var_dump(bcmul($a, $b, 3) * 1); var_dump(round_up($a * $b)); var_dump(round($a * $b, 2, PHP_ROUND_HALF_UP)); var_dump(round_up(bcmul($a, $b, 3))); ?>
based on 35BQk
Output for 5.3.20 - 5.5.28, 5.5.31 - 5.5.33, 5.5.35 - 5.6.12, 5.6.16 - 5.6.19, 5.6.21 - 7.0.4, 7.0.6 - 7.2.0
float(259.2) float(259.2) float(259.21) float(259.2) float(259.2) float(259.902) float(259.902) float(259.91) float(259.9) float(259.91)
Output for 7.0.5
float(259.2) Fatal error: Uncaught Error: Call to undefined function bcmul() in /in/XLKcK:11 Stack trace: #0 {main} thrown in /in/XLKcK on line 11
Process exited with code 255.
Output for 5.5.29 - 5.5.30, 5.5.34, 5.6.13 - 5.6.15, 5.6.20
float(259.2) Fatal error: Call to undefined function bcmul() in /in/XLKcK on line 11
Process exited with code 255.