3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $numbers = array( 20/3, 20/3 * 1e6, 6.66, 6.0, 60.0, 10/9, 1000000000000000000000000000000000, ); $p = (int) ini_get('precision'); foreach ($numbers as $n) { echo 'RAW: ' . $n . "\n"; echo 'EXP: ' . var_export($n, TRUE) . "\n"; echo 'FIX: ' . rtrim(rtrim(sprintf('%.' . max($p - ceil(log10($n))), 0) . 'F', $n), '0'), '.') . "\n"; echo "\n"; }
Output for 5.3.0 - 5.4.22
Parse error: syntax error, unexpected ')', expecting ',' or ';' in /in/j6vEi on line 18
Process exited with code 255.