Class members' visibility : protected « Class « PHP






Class members' visibility

 
public: can be accessed by any other code
private: can be accessed only from within the same class. 
protected: may be accessed from within the class and from within any class that extends that class.
  
  








Related examples in the same category

1.protected member variable
2.Class using access control
3.Private and protected variables
4.Properties and methods marked as protected are accessible only through the object that owns them