1--TEST-- 2GH-12143: Test rounding of 1.5. 3--FILE-- 4<?php 5foreach ([ 6 1.5, 7 -1.5, 8] as $number) { 9 foreach ([ 10 'PHP_ROUND_HALF_UP', 11 'PHP_ROUND_HALF_DOWN', 12 'PHP_ROUND_HALF_EVEN', 13 'PHP_ROUND_HALF_ODD', 14 ] as $mode) { 15 printf("%-20s: %+.17g -> %+.17g\n", $mode, $number, round($number, 0, constant($mode))); 16 } 17} 18?> 19--EXPECT-- 20PHP_ROUND_HALF_UP : +1.5 -> +2 21PHP_ROUND_HALF_DOWN : +1.5 -> +1 22PHP_ROUND_HALF_EVEN : +1.5 -> +2 23PHP_ROUND_HALF_ODD : +1.5 -> +1 24PHP_ROUND_HALF_UP : -1.5 -> -2 25PHP_ROUND_HALF_DOWN : -1.5 -> -1 26PHP_ROUND_HALF_EVEN : -1.5 -> -2 27PHP_ROUND_HALF_ODD : -1.5 -> -1 28