What are the best practices for setting parameters in PHP functions?

When setting parameters in PHP functions, it is important to define the data type and default value (if applicable) for each parameter. This helps improve code readability, maintainability, and prevents unexpected errors. Additionally, documenting the parameters in the function's comments can provide clarity for other developers using the function.

function calculateTotal(int $quantity, float $price, string $currency = 'USD') {
    // Function code here
}