_ Autoload ($ classname); unlike other magic methods, this magic method is not used in the class, and others are used inside the class, if a class is used on the page, the class name is automatically passed to the parameter of the function. It is used in development to automatically load classes.
_ Sleep (): This method is automatically called when the object is serialized, because serialize ($ object) is used when the object is serialized. If this magic method is not added to the class, all attributes in the class are automatically serialized. If you only want to serialize some attributes, you need to use this method. This method returns an array composed of attributes of the class. Which attribute of the sequence is placed in the array. Purpose: serialize part of an object.
$ STR = serialize ($ object) // serialize an object to a binary string.
$ Newobject = unserialize ($ Str); // convert a binary string into a new object. This new object has the attributes and methods of the original object.
_ Wakeup (): The method automatically called during deserialization, because a new object is generated during object deserialization, and each time a new object is generated, generally, this object must be initialized (not required, depending on the situation). Therefore, the role of this magic method is to initialize the new object.
_ Clone (): The method automatically called when the object is cloned. $ this in this method indicates the object just cloned, this magic method is also used to initialize the new cloned object. $ That indicates the original object, but it is difficult to use it.
_ Call ($ fnname, argS): it is automatically called when an object does not exist in an external call class. It is used to handle errors that do not exist. This method accepts two parameters, the first parameter is the name of the method that does not exist for access, and the second parameter is the parameter array of the method that does not exist.
_ Tostring (): it is automatically called when an object reference is directly output. Because the object cannot be directly used in the class, it is used to quickly obtain the quickest way to express the object string.