3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $value = 1.002302; $v = explode('.', $value); $p = 0; for ($i = 0; $i < strlen($v[1]); $i++) { if (substr($v[1], $i, 1) > 0) { $p = $i+1; } } print round($value, $p)
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected end of file in /in/ST6CC on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/ST6CC on line 10
Process exited with code 255.