The __destruct will not be called:
- If
exitis called in another destructor - Depending on the PHP Version: if
exitis called in a shutdown function registered withregister_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 (PHP >= 5.3.0)
Guess that’s all I can think of right now
& What Pascal MARTIN said. That’s the first step of debugging that.