3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php for ($x=1;$x<24;$x++) { #var_dump($x / 2); $bla= round($x /2,PHP_ROUND_HALF_UP)."\n"; echo nl2br($bla); }
based on 24E2A
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
0.5<br /> 1<br /> 1.5<br /> 2<br /> 2.5<br /> 3<br /> 3.5<br /> 4<br /> 4.5<br /> 5<br /> 5.5<br /> 6<br /> 6.5<br /> 7<br /> 7.5<br /> 8<br /> 8.5<br /> 9<br /> 9.5<br /> 10<br /> 10.5<br /> 11<br /> 11.5<br />
Output for 4.3.0 - 5.2.17
Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 1<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 1<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 2<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 2<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 3<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 3<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 4<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 4<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 5<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 5<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 6<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 6<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 7<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 7<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 8<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 8<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 9<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 9<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 10<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 10<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 11<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 11<br /> Notice: Use of undefined constant PHP_ROUND_HALF_UP - assumed 'PHP_ROUND_HALF_UP' in /in/s0LKO on line 5 12<br />