3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $number = 3.0000000000000000000000002; $rounded = round($number, 6); if (abs($number -$rounded) < $delta) { $result = intval($number); } echo "Rounded result: ".$result.PHP_EOL;
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: delta in /in/5b7mq on line 9 Notice: Undefined variable: result in /in/5b7mq on line 15 Rounded result:
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.0.3
Notice: Undefined variable: delta in /in/5b7mq on line 9 Notice: Undefined variable: result in /in/5b7mq on line 15 Rounded result:
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Undefined variable: delta in /in/5b7mq on line 9 Notice: Undefined variable: result in /in/5b7mq on line 15 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/5b7mq on line 15 Rounded result: PHP_EOL