Solved What is the difference between public, protected and private in a class definition?

LPH

Flight Director
Staff member
In PHP, the following keywords are declared as prefixes public, protected or private.

Specifically, the visibility properties are very important in Object Oriented Programming (OOP): public makes a class member available to "everyone", protected makes the class member available to only itself and derived classes, private makes the class member only available to the class itself.
 
Top