3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(floor((0.1+0.7)*10)); echo PHP_EOL; var_dump(gmp_add(0.1, 0.7)); echo PHP_EOL; var_dump(floor( bcmul( bcadd(0.1, 0.7), 10 ) ));
based on BHmBW
Output for 5.4.10 - 5.5.28, 5.5.31 - 5.5.33, 5.6.8 - 5.6.12, 5.6.16 - 5.6.19, 5.6.28 - 7.0.4, 7.0.20 - 7.2.0
float(7) Warning: gmp_add(): Unable to convert variable to GMP - wrong type in /in/f0gQk on line 5 bool(false) float(0)
Output for 7.0.6
float(7) Fatal error: Uncaught Error: Call to undefined function gmp_add() in /in/f0gQk:5 Stack trace: #0 {main} thrown in /in/f0gQk on line 5
Process exited with code 255.
Output for 7.0.5
float(7) Warning: gmp_add(): Unable to convert variable to GMP - wrong type in /in/f0gQk on line 5 bool(false) Fatal error: Uncaught Error: Call to undefined function bcmul() in /in/f0gQk:7 Stack trace: #0 {main} thrown in /in/f0gQk on line 7
Process exited with code 255.
Output for 5.3.20 - 5.3.29, 5.5.35, 5.6.21
float(7) Fatal error: Call to undefined function gmp_add() in /in/f0gQk on line 5
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(7) Warning: gmp_add(): Unable to convert variable to GMP - wrong type in /in/f0gQk on line 5 bool(false) Fatal error: Call to undefined function bcmul() in /in/f0gQk on line 8
Process exited with code 255.