1--TEST-- 2round() with modes PositiveInfinity and NegativeInfinity 3--FILE-- 4<?php 5 6$numbers = [ 7 2.5, 8 -2.5, 9 3.5, 10 -3.5, 11 7, 12 -7, 13 0.61, 14 0.69, 15 0, 16 -0, 17 1.9999, 18 -1.9999, 19 0.0001, 20 -0.0001, 21]; 22 23echo "mode PositiveInfinity\n"; 24foreach($numbers as $number) { 25 var_dump(ceil($number) === round($number, 0, RoundingMode::PositiveInfinity)); 26} 27 28echo "\n"; 29echo "mode NegativeInfinity\n"; 30foreach($numbers as $number) { 31 var_dump(floor($number) === round($number, 0, RoundingMode::NegativeInfinity)); 32} 33 34?> 35--EXPECT-- 36mode PositiveInfinity 37bool(true) 38bool(true) 39bool(true) 40bool(true) 41bool(true) 42bool(true) 43bool(true) 44bool(true) 45bool(true) 46bool(true) 47bool(true) 48bool(true) 49bool(true) 50bool(true) 51 52mode NegativeInfinity 53bool(true) 54bool(true) 55bool(true) 56bool(true) 57bool(true) 58bool(true) 59bool(true) 60bool(true) 61bool(true) 62bool(true) 63bool(true) 64bool(true) 65bool(true) 66bool(true) 67