What potential pitfalls should be considered when defining functions within classes in PHP?

One potential pitfall when defining functions within classes in PHP is the risk of namespace conflicts or name collisions if the function name is not unique within the class or clashes with functions from parent classes or external libraries. To avoid this, it is good practice to prefix function names with the class name or use namespaces to organize your code.

class MyClass {
    public function myFunction() {
        // function implementation
    }
}