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 '$v' (T_VARIABLE) in /in/r1CaF on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/r1CaF on line 3
Process exited with code 255.