I hope you are doing well. I have a question regarding access modifiers for class methods in PHP. I have been learning PHP recently and I am a bit confused about the different access modifiers that can be used for class methods.
I understand that access modifiers determine the visibility of properties and methods within a class. In PHP, there are three main access modifiers: public, private, and protected.
From my understanding, a public method can be accessed from anywhere, both inside and outside the class. This means that other classes and objects can call this method freely.
On the other hand, a private method can only be accessed from within the class itself. This means that other classes or objects cannot access or call this method.
Lastly, a protected method can be accessed from within the class itself and any child classes that inherit from it. This means that a protected method is somewhat similar to a private method, but it can be accessed by any child classes as well.
I would like to confirm my understanding of these access modifiers and also see if there are any additional access modifiers in PHP that I might have missed.
Thank you in advance for your help and explanations!