3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $n = 0 - 0.0000000000000000000000000001; var_dump($n); // float(-1.0E-33) var_dump(round($n)); // float(-0) var_dump(abs($n)); // float(1.0E-33) var_dump(abs(round($n))); // float(0) var_dump(round($n) == 0); // bool(true) var_dump(round($n) === 0); // bool(false)
Output for 5.2.1 - 5.3.3, 5.3.7 - 7.1.0
float(-1.0E-28) float(-0) float(1.0E-28) float(0) bool(true) bool(false)
Output for 4.3.3 - 5.0.5, 5.1.1 - 5.2.0, 5.3.4 - 5.3.6
float(-1.0E-28) float(0) float(1.0E-28) float(0) bool(true) bool(false)
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/VdIjF on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.2
float(-1.E-28) float(0) float(1.E-28) float(0) bool(true) bool(false)