Php object-oriented magic methods are described in Chinese. 1. the _ construct () instantiated object is automatically called. When _ construct and a function with the class name exist at the same time, _ construct is called, and the other one does not call it back. Function name function 1. _ construct ()
The instantiated object is automatically called. When _ construct and a function with the class name exist at the same time, _ construct is called, and the other one does not call it back.
The class name function is the old version of the constructor.
2. _ destruct ()
When an object or object is deleted, it is called.
3. _ call ()
Object to call a method. If the method does not exist, call the _ call method.
4. _ get ()
Read an object property. if the object property is private, it will be called.
5. _ set ()
When an object property is assigned a value, if the property is private, it will be called.
6. _ toString ()
When printing an object, it is called.
7. _ clone ()
Called when an object is cloned, for example, $ a = new test (); $ a1 = clone $;
8. _ sleep ()
Serialize is called before. if the object is large, you can use it to delete something before serialization.
9. _ wakeup ()
Unserialize is called to initialize objects.
10. _ isset ()
Checks whether an object's attribute exists. if the detected attribute is private, it is called.
11. _ unset ()
When deleting an object property, if the deleted object property is private, it will be called.
12. _ set_state ()
Called when var_export is called. Use the return value of _ set_state as the return value of var_export.
13. _ autoload ()
When instantiating an object, if the corresponding class does not exist, the method will be deprecated.
The http://www.bkjia.com/PHPjc/736805.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/736805.htmlTechArticle1.__construct () instantiated object is called automatically. When _ construct and a function with the class name exist at the same time, _ construct is called, and the other one does not call it back. Function name...