What are the potential pitfalls of using private methods in PHP classes, especially in terms of access control and inheritance?

Using private methods in PHP classes can limit access to those methods only within the class they are defined in, which can hinder inheritance and make it difficult to override or extend functionality in subclasses. To address this issue, consider using protected methods instead, which allows subclasses to access and override these methods while still restricting access from outside the class.

class ParentClass {
    protected function myMethod() {
        // Method implementation
    }
}

class ChildClass extends ParentClass {
    // ChildClass can access and override myMethod
}