PHP has a number of special functions and methods, these functions and methods compared to the ordinary method of the special point is that the user code is usually not active invocation, but at a specific time will be automatically called by PHP .
In PHP, usually the "__" method is used as a magic method, the PHP manual recommends that the custom method do not use __.
The magic Methods of PHP are:
__construct (), __destruct (), __call (), __callstatic (), __get (), __set (), __isset (), __unset (), __sleep (), __wakeup (), __ ToString (), __invoke (), __set_state (), __clone () and __debuginfo ()
__construct (), construction method, familiar with object-oriented students should be familiar with the new object in the time to allocate space for the object.
__destruct (), the constructor method corresponds to the Destructor method, which allows some operations to be performed before destroying a class or to complete functions such as closing a file, releasing a result set, and so on. destructors cannot have parameters
The above describes the PHP magic method definition, including the PHP magic method of content, I hope that the PHP tutorial interested in a friend helpful.