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, 2) * 1); var_dump(round_up($a * $b)); var_dump(round_up(bcmul($a, $b, 2))); echo "\n"; $a = 5.4; $b = 48.13; var_dump($a * $b); var_dump(bcmul($a, $b, 2) * 1); var_dump(round_up($a * $b)); var_dump(round_up(bcmul($a, $b, 2))); ?>
based on uhpAo
Output for 5.3.20 - 5.4.45, 5.5.17, 5.6.0 - 5.6.38, hhvm-3.10.1 - 3.22.0, 7.0.0 - 7.3.1
float(259.2) float(259.2) float(260) float(260) float(259.902) float(259.9) float(260) float(260)
Output for 5.5.0 - 5.5.16, 5.5.18 - 5.5.38
float(259.2) Fatal error: Call to undefined function bcmul() in /in/D1sdp on line 11
Process exited with code 255.