3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $number1 = 354.2550; $number2 = 38456.12; //echo strlen(substr(strrchr($number1, "."), 1)) . "<br />"; //echo strlen(substr(strrchr($number2, "."), 1)); echo number_format(round($number1, 2), strlen(substr(strrchr($number1, "."), 1)), ',', '.') + 0; echo PHP_EOL; echo number_format(round($number2, 2), strlen(substr(strrchr($number2, "."), 1)), ',', '.') + 0;
Output for 7.1.0 - 7.2.0
Notice: A non well formed numeric value encountered in /in/EdFX7 on line 8 354 Notice: A non well formed numeric value encountered in /in/EdFX7 on line 10 38.456
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.0.20
354 38.456
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
354 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EdFX7 on line 9 PHP_EOL38.456