--TEST-- BcMath\Number round() --EXTENSIONS-- bcmath --FILE-- round(0, $mode); if ($method_ret->compare($func_ret) !== 0) { echo "Result is incorrect.\n"; var_dump($number, $mode, $func_ret, $method_ret); } } } foreach (RoundingMode::cases() as $mode) { foreach ([ '1.2345678', '-1.2345678', ] as $number) { $func_ret = bcround($number, 5, $mode); $method_ret = (new BcMath\Number($number))->round(5, $mode); if ($method_ret->compare($func_ret) !== 0) { echo "Result is incorrect.\n"; var_dump($number, $mode, $func_ret, $method_ret); } } } echo 'done!'; ?> --EXPECT-- done!