3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $z = -1.0; while ($z != 0.0) { $z /= 2.0; } var_dump($z); var_dump(serialize($z)); var_dump(unserialize("d:-0;")); print_r($z);
based on kQWDY
Output for 5.2.1 - 7.2.0
float(-0) string(5) "d:-0;" float(-0) -0
Output for 4.3.2 - 5.2.0
float(0) string(4) "d:0;" float(0) -0
Output for 4.3.0 - 4.3.1
float(0) string(5) "d:-0;" float(0) -0