When will __destruct not be called in PHP?

The __destruct will not be called: If exit is called in another destructor Depending on the PHP Version: if exit is called in a shutdown function registered with register_shutdown_function If there is a fatal error somewhere in the code If another destructor throws an exception If you try to handle an exception in a destructor … Read more