What are the potential pitfalls of using the PHP_ROUND_HALF_DOWN constant in PHP rounding functions?

When using the PHP_ROUND_HALF_DOWN constant in PHP rounding functions, one potential pitfall is that it always rounds towards zero, which may not always give the desired result. To solve this issue, you can implement custom rounding logic to achieve the desired rounding behavior.

function customRound($number, $precision) {
    $multiplier = pow(10, $precision);
    $rounded = round($number * $multiplier) / $multiplier;
    return $rounded;
}

// Example usage
$number = 3.675;
$precision = 2;
$roundedNumber = customRound($number, $precision);
echo $roundedNumber; // Output: 3.68