3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php 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 WOefC
Output for 7.0.0 - 7.2.0
Precision: 14 0.3 false Precision: 17 0.3 false Precision: 33 0.3 false
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28
Precision: 14 0.3 false Precision: 17 0.30000000000000004 false Precision: 33 0.300000000000000044408920985006262 false
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EGfSP on line 2 Precision: 14PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EGfSP on line 3 0.3PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EGfSP on line 4 falsePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EGfSP on line 7 Precision: 17PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EGfSP on line 8 0.30000000000000004PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EGfSP on line 9 falsePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EGfSP on line 12 Precision: 33PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EGfSP on line 13 0.300000000000000044408920985006262PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EGfSP on line 14 falsePHP_EOL