3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $value = 1.0; $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.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined offset: 1 in /in/bL6Mp on line 5 1
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined index: 1 in /in/bL6Mp on line 5 1
Output for 4.3.0 - 5.2.17
Notice: Undefined offset: 1 in /in/bL6Mp on line 5 1