1: Magic function
Instantiated object is called.
When the __construct and in class while the function called function name exists, __construct is called, the other not to be called.
When you remove an object or object is called when the operation terminated.
__call () object called a method,
If the method exists, a direct call; if there will be to call the __call function.
__get () to read an object's attributes.
If the property exists, the direct return property values; if there will be call the __get function.
__set () to set an object property.
If the property exists, the direct assignment; if there will be calls __set function.
When printing an object is called. If echo $ obj; or print $ obj;
Cloned object is invoked. Such as: $ t = new Test (); $ t1 = clone $ t;
be called before serialize. If the object larger, to cut a little stuff and then serialized, can consider this function.
unserialize when called, do object initialization.
Detect the existence of the properties of an object when called. Such as: isset ($ c-> name).
unset attribute of an object is called. Such as: unset ($ c-> name).
Call var_export, they were called. The return value with __set_state as var_export the return value.
Instance of an object, if the corresponding class does not exist, then the method is called.
2: Magic variable
Back to document the current line number.
Back to document the full path and file name. If the included file is returned that contains the file name. Starting from PHP 4.0.2, __FILE__ always contains an absolute path, in which the previous version sometimes includes a relative path.
Return the function name (PHP4.3.0 added). Since PHP5 from this constant returns the function is defined by the name (case sensitive). In PHP4, the value is always lower case letters.
Back to the class name (PHP4.3.0 added). Since PHP5 from the constant returns the class is defined by the name (case sensitive). In PHP4, the value is always lower case letters.
Back to class method names (PHP5.0.0 added). Return the method is defined by the name (case sensitive).