Overloading in PHP provides the ability to add object members at runtime. This is done by having the class implement the overloading methods __get, __set, __call and __callStatic. Bear in mind that the meaning of overloading in PHP is different from many other languages.
The __get and __set methods provide a convenient way to implement getter and setter methods, which are methods that are often used to safely read and write to properties. These overloading methods are invoked when using properties that are inaccessible, either because they are not defined in the class or because they are unavailable ...