3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $min = round('2.9343434',2, PHP_ROUND_HALF_DOWN); var_dump((int)$min); var_dump($min); $a = 1.23456789; $b = 1.23456780; var_dump($a == $b);
Output for 5.3.0 - 7.2.0
int(2) float(2.93) bool(false)
Output for 4.3.0 - 5.2.17
Notice: Use of undefined constant PHP_ROUND_HALF_DOWN - assumed 'PHP_ROUND_HALF_DOWN' in /in/lEftT on line 2 Warning: Wrong parameter count for round() in /in/lEftT on line 2 int(0) NULL bool(false)