3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo "locale default\n"; $a = 0.5; echo $a; echo "\n"; echo sprintf('%.02f', $a); echo "\n"; echo "locale fr_FR.UTF-8"; echo "\n"; setlocale(LC_ALL, 'fr_FR.UTF-8'); echo $a; echo "\n"; echo sprintf('%.02f', $a); ?>
Output for 4.3.0 - 7.1.0
locale default 0.5 0.50 locale fr_FR.UTF-8 0.5 0.50