3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo round('2.555', 2); echo round('2.555', 2, PHP_HALF_ROUND_UP);
Output for 7.2.0
2.56 Warning: Use of undefined constant PHP_HALF_ROUND_UP - assumed 'PHP_HALF_ROUND_UP' (this will throw an Error in a future version of PHP) in /in/ZYdUr on line 4 Warning: round() expects parameter 3 to be integer, string given in /in/ZYdUr on line 4
Output for 7.0.0 - 7.1.10
2.56 Notice: Use of undefined constant PHP_HALF_ROUND_UP - assumed 'PHP_HALF_ROUND_UP' in /in/ZYdUr on line 4 Warning: round() expects parameter 3 to be integer, string given in /in/ZYdUr on line 4
Output for 5.3.18 - 5.6.28
2.56 Notice: Use of undefined constant PHP_HALF_ROUND_UP - assumed 'PHP_HALF_ROUND_UP' in /in/ZYdUr on line 4 Warning: round() expects parameter 3 to be long, string given in /in/ZYdUr on line 4