Ec (2); 1. _ Construct () is called when an object is instantiated. When _ construct and a function with the same class name exist at the same time, __construct is called, and the other is not called. 2. _ Destruct () is called when an object or object operation is terminated. 3. The _ call () object calls a method. If a method exists, it is called directly. If the method does not exist, the _ call function is called. 4. _ Get () reads a script ec (2); a script
1. _ Construct ()
Called when instantiating an object,
When _ construct and a function with the class name both exist, __construct will be called and the other will not be called.
2. _ Destruct ()
It is called when an object or object operation is terminated.
3. _ Call ()
Object calls a method,
If a method exists, it is called directly;
If not, the _ call function is called.
4. _ Get ()
When reading the attributes of an object,
If a property exists, the property value is directly returned;
If not, the _ get function is called.
5. _ Set ()
When setting attributes of an object,
If an attribute exists, the value is assigned directly;
If not, the _ set function is called.
6. _ ToString ()
It is called to print an object. Such as echo $ obj; or print $ obj;
7. _ Clone ()
Called when cloning an object. For example: $ t = new Test (); $ t1 = clone $ t;
8. _ Sleep ()
Serialize is called before. If the object is large and you want to delete something and serialize it, consider this function.
9. _ Wakeup ()
Unserialize is called to initialize objects.
10. _ Isset ()
It is called to check whether an object property exists. For example, isset ($ c-> name ).
11. _ Unset ()
Unset an object property is called. For example, unset ($ c-> name ).
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, this method is called.