to rephrase,
you have a script that loops forever. you want to add something to your class that will end the loops when the server says its stopping php.
i've never heard of a destructor before, but i think you're looking for garbage collection.
Php - Php Mysql - Garbage Collection Tutorials