PHP – Access Modifiers
Properties and methods can have access modifiers which control where they can be accessed.
There are three access modifiers:
public
– the property or method can be accessed from everywhere. This is defaultprotected
– the property or method can be accessed within the class and by classes derived from that classprivate
– the property or method can ONLY be accessed within the class