Ending Chapters in Code with Destructive Grace Destructors are the opposite of constructors…go figure. The destructor method is called after the object is not referenced any more. In PHP, the constructor is called first, followed by any internal methods that the user accesses, followed by the destructor method for final cleanup. The destructor is even called if the PHP script is exited using PHP’s exit() function. https://www.dinocajic.com/php-constructors/ To create a destructor method, we’ll follow a similar naming convention to the constructor method. You start with two underscores, followed by the keyword destruct: __destruct(). <?php class ClassName { //… public function __destruct() { //…