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;
based on tNMjk
Output for 7.0.0 - 7.2.6
Precision: 14 0.3 false Precision: 17 0.3 false
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.25
Precision: 14 0.3 false Precision: 17 0.30000000000000004 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/WOefC on line 2 Precision: 14PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WOefC on line 3 0.3PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WOefC on line 4 falsePHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WOefC on line 7 Precision: 17PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WOefC on line 8 0.30000000000000004PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/WOefC on line 9 falsePHP_EOL