3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function ex_round($_,$__ = 1){ if(0== round($_, $__, PHP_ROUND_HALF_EVEN)){ return ex_round($_,$__+1); } return round($_, $__, PHP_ROUND_HALF_EVEN); } echo ex_round(0.005); echo ex_round(1.005); echo PHP_EOL; echo round(0.005, 1, PHP_ROUND_HALF_ODD);
Output for 5.3.0 - 7.2.0
0.0051 0