We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37ce719 commit 96eb2f4Copy full SHA for 96eb2f4
ext/standard/math.c
@@ -335,6 +335,17 @@ PHP_FUNCTION(round)
335
}
336
337
338
+ switch (mode) {
339
+ case PHP_ROUND_HALF_UP:
340
+ case PHP_ROUND_HALF_DOWN:
341
+ case PHP_ROUND_HALF_EVEN:
342
+ case PHP_ROUND_HALF_ODD:
343
+ break;
344
+ default:
345
+ zend_argument_value_error(3, "must be a valid rounding mode (PHP_ROUND_*)");
346
+ RETURN_THROWS();
347
+ }
348
+
349
switch (Z_TYPE_P(value)) {
350
case IS_LONG:
351
/* Simple case - long that doesn't need to be rounded. */
0 commit comments