From the later version of PHP5, the class will be able to use the Magic method. PHP rules to start with two underscore (__) methods are preserved as a magic method, it is recommended that the function name is best not to start without __, unless it is to reload the existing magic method.
Currently all of PHP's magic methods have a look at these
__construct () __destruct () __call () __callstatic () __get () __set () __isset () __unset () __sleep () __wakeup () __toString () __invoke () __set_state () __clone () __debuglnfo ()
Why study these magic methods, can enrich our knowledge. That's what programmers do, and when you feel like you need a certain point of knowledge, you're definitely going to study it.
It can be seen here that the magic method of naming all starts with ' __ ' is two ' _ '
So when we define the method of the class, we don't use ' __ ' to define
The above describes the PHP magic method description, including the PHP magic method of content, I hope that the PHP tutorial interested in a friend to help.