What are best practices for passing parameters to functions in PHP classes?

When passing parameters to functions in PHP classes, it is considered a best practice to define the parameters in the function declaration to make the code more readable and maintainable. Additionally, using type hinting can help ensure that the correct data types are passed to the function. Lastly, providing default parameter values can make the function more flexible.

class MyClass {
    public function myFunction(string $param1, int $param2 = 0) {
        // Function logic here
    }
}

// Usage
$myObject = new MyClass();
$myObject->myFunction('hello', 10);