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('%f', 1000000); print "\n"; print sprintf('%f', 100); print "\n"; print sprintf('%g', -1); print "\n"; print sprintf('%f', 0.00000001); print "\n"; print sprintf('%f', -0.00000001);
Output for 5.2.1 - 7.1.0
0.001 0 1000000.000000 100.000000 -1 0.000000 -0.000000
Output for 4.3.0 - 5.2.0
1000000.000000 100.000000 0.000000 -0.000000