I'm relatively new to PHP and object-oriented programming, and I'm currently working on a project where I need to understand method visibility and access modifiers in PHP classes. I have a few questions and I hope someone can shed some light on this topic for me.
1. What are method visibility and access modifiers in PHP classes?
2. How do method access modifiers (such as public, private, and protected) affect the visibility and access to methods within a class?
3. What are the best practices when it comes to choosing the appropriate access modifiers for my methods?
4. Are there any specific scenarios or use cases where certain access modifiers are preferred over others?
I would really appreciate any insights or explanations that can help me better grasp the concept of method visibility and access modifiers in PHP classes. Thanks in advance for your help!