June 2017
Intermediate to advanced
536 pages
9h 49m
English
Aside from method overloading, property overloading is another aspect of the PHP overloading capabilities. There are four magic methods in PHP that support the property overloading: __set(), __get(), __isset(), and __unset(). Throughout this section, we will take a closer look at the __set() method.
The __set() magic method is triggered when trying to write data to inaccessible properties.
The method accepts two parameters, as per the following synopsis:
public void __set(string $name, mixed $value)
Whereas, the __set() method parameters have the following meaning:
Let's take a look at the following ...