3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php print sprintf('%g', 0.001); print "\n"; print sprintf('%g', 0); print "\n"; print sprintf('%g', 1000000); print "\n"; print sprintf('%g', 100); print "\n"; print sprintf('%g', -1); print "\n"; print sprintf('%g', 0.00000001); print "\n"; print sprintf('%g', -0.00000001);
Output for 5.2.1 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
0.001 0 1.0e+6 100 -1 1.0e-8 -1.0e-8
Output for 4.3.0 - 5.2.0