August 2013
Intermediate to advanced
140 pages
1h 49m
English
CHAPTER 22
![]()
Magic Methods
There are a number of methods that can be implemented in a class for the purpose of being called internally by the PHP engine. These are known as magic methods and they are easy to recognize as they all start with two underscores. Listed in the table below are the magic methods that have been discussed so far.
| Name | Description |
|---|---|
| __construct(. . .) | Called when creating a new instance. |
| __destruct() | Called when object has no references left. |
| __call($name, $array) | Called when invoking inaccessible methods in an object context. |
| __callStatic($name, $array) | Called when invoking inaccessible methods in a ... |
Read now
Unlock full access