What are some best practices for naming functions within classes in PHP?

When naming functions within classes in PHP, it is important to follow a consistent naming convention to improve code readability and maintainability. One common practice is to use camelCase for function names, starting with a lowercase letter. Additionally, it is recommended to use descriptive names that clearly indicate the purpose of the function.

class MyClass {
    public function doSomething() {
        // code here
    }

    public function calculateTotal($num1, $num2) {
        // code here
    }
}