NogDog is right.
Last year I tried destroyinh object from within class.
No matter what clever tricks I tried .. it was really hopeless.
I think we can compare this with a function trying to alter or delete itself.
It wont happen.
A class and methods and $this and $var declarations are not active/dynamic elements.
The object is created OUTSIDE. This is the active element.
$db = new Database();
The only way to remove $db object is at the OUTSIDE.
$this is no object. $this only an inside class handle, like a statement.
So, if you do not want to wait for the object to self-destroy at script end
or at exit()
$db = new Database();
unset($db);
Which was the solution I had to finally settle for, the result of my investigation last year.