3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = 4121.57;$b = 3998;$c = 123.57;$d = round( $a - $b - $c, 2);$e = round( $d, 2 ); echo "\n";echo str_pad(print_r($d,TRUE),4,' ')." // NEGATIVE ZERO?"."\n";echo str_pad(print_r($e,TRUE),4,' ')." // Don't worry, it rounds to zero! -_-"."\n";var_dump($e == 0, $e === 0, $e == -0, $e === -0);
based on ZiBGg
Output for 4.3.0 - 5.2.6, 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
-0 // NEGATIVE ZERO? 0 // Don't worry, it rounds to zero! -_- bool(true) bool(false) bool(true) bool(false)
Output for 5.2.7 - 5.2.17
-0 // NEGATIVE ZERO? -0 // Don't worry, it rounds to zero! -_- bool(true) bool(false) bool(true) bool(false)