From 17f3e65fee208bdd1ef8c0f03ed15ae276793ee3 Mon Sep 17 00:00:00 2001 From: Ivan Fedorov Date: Thu, 29 Aug 2024 12:41:28 +0200 Subject: [PATCH] fix default value for \round --- standard/standard_3.php | 2 +- tests/TestData/mutedProblems.json | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/standard/standard_3.php b/standard/standard_3.php index ea9dcc2b4..3c68fc772 100644 --- a/standard/standard_3.php +++ b/standard/standard_3.php @@ -131,7 +131,7 @@ function floor(int|float $num) {} * @return float The rounded value */ #[Pure] -function round(int|float $num, int $precision = 0, #[LanguageLevelTypeAware(['8.4' => 'RoundingMode|int'], default: 'int')] $mode = RoundingMode::HalfAwayFromZero): float {} +function round(int|float $num, int $precision = 0, #[LanguageLevelTypeAware(['8.4' => 'RoundingMode|int'], default: 'int')] $mode = 0): float {} /** * Sine diff --git a/tests/TestData/mutedProblems.json b/tests/TestData/mutedProblems.json index 889cd9cd5..38f42bbc9 100644 --- a/tests/TestData/mutedProblems.json +++ b/tests/TestData/mutedProblems.json @@ -574,6 +574,20 @@ } ], "functions": [ + { + "name": "round", + "parameters": [ + { + "name": "$mode", + "problems": [ + { + "description": "wrong default value", + "versions": [8.4] + } + ] + } + ] + }, { "name": "each", "problems": [