Home >Web Front-end >JS Tutorial >Summary of specific usage of php destructor_javascript skills
To put it simply, the destructor is used to complete special work when the object is closed. For example, in the above example I wrote, a file is opened at the same time as it is instantiated, but when will it be closed? Just close it after use. Therefore, the destructor directly closes it, or during destruction, we write some of the processed data into the database. In this case, we can consider using the destructor to complete it. Before the destructor is completed, these object attributes remain exists and is only used for internal access, so you can safely do any aftermath work related to the object The destructor is not to release the object's own memory, but to use it when the user needs to release some additional memory. To guide PHP where the memory that needs to be released is. Finally, PHP uses