public - the property or method is accessible from any location. This is the default setting.
protected - the property or method can only be accessed by members of the class and classes descended from it.
private - the property or method can only be accessed by other members of the same class.
There are three types of access modifiers: public, private, and protected, as previously noted.
The private access modifier can be used on class variables and methods, but not on PHP classes. When a class member, such as a variable or a function, is designated private, it cannot be accessed directly through the class object.