What are best practices for handling parameter passing in PHP functions?

When passing parameters in PHP functions, it is best practice to clearly define the expected data types for each parameter to ensure type safety and prevent unexpected behavior. Additionally, it is recommended to provide default values for optional parameters to make the function more flexible and easier to use. Finally, consider using type hinting to enforce specific data types for parameters to improve code readability and maintainability.

function exampleFunction(int $param1, string $param2 = 'default') {
    // function implementation
}