3v4l.org

run code in 300+ PHP versions simultaneously
<?php bcscale(2); print bcadd('-0.0', '-0.0') . '<br>'; // prints: -0.00, should be: 0.00 print bccomp('-0.0', '0') . '<br>'; // prints: -1, should be: 0
based on 9EKHc
Output for 7.0.24 - 7.0.33, 7.1.10 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.27, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
0.00<br>0<br>
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.1 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.23, 7.1.0 - 7.1.9
-0.00<br>-1<br>
Output for 5.4.0 - 5.4.45
Fatal error: Call to undefined function bcscale() in /in/J93YJ on line 2
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/J93YJ on line 4
Process exited with code 255.