unset and __destruct
View Single Post
05-03-2008, 07:51 PM
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
I may be wrong about this, but I'm pretty sure unset()ing the object will destroy all the variables ($this) contained within that object without the need of explicitly doing so in the __destruct() method.
I also read a note in the manual stating that when if you are planning to destroy an object before the end of the script (ie, half way through, right after using it, etc), that you may want to call __destruct yourself. Otherwise PHP will wait until the end of the script before calling the method and you won't be gaining any resources along the way.
View Public Profile
Send a private message to delayedinsanity
Visit delayedinsanity's homepage!
Find More Posts by delayedinsanity