3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php printf("%0.14f", (0.1 + 0.2) ); echo PHP_EOL; echo "Precision: " . ini_get('precision') . PHP_EOL; echo (0.1 + 0.2) . PHP_EOL; echo ((0.1 + 0.2) === 0.3 ? 'true' : 'false') . PHP_EOL; ini_set('precision', 17); echo "Precision: " . ini_get('precision') . PHP_EOL; echo (0.1 + 0.2) . PHP_EOL; echo ((0.1 + 0.2) === 0.3 ? 'true' : 'false') . PHP_EOL; ini_set('precision', 33); echo "Precision: " . ini_get('precision') . PHP_EOL; echo (0.1 + 0.2) . PHP_EOL; echo ((0.1 + 0.2) === 0.3 ? 'true' : 'false') . PHP_EOL;
based on TMWgR
Output for 7.0.0 - 7.2.0
0.30000000000000 Precision: 14 0.3 false Precision: 17 0.3 false Precision: 33 0.3 false
Output for 5.3.19 - 5.6.28
0.30000000000000 Precision: 14 0.3 false Precision: 17 0.30000000000000004 false Precision: 33 0.300000000000000044408920985006262 false