Page 1 of 1

destruct

Posted: Tue Jul 06, 2010 10:00 am
by dhinge
I have a class that opens a connection to MySQL, but upon __destruct, the class doesn't close the connection. Isn't __destruct supposed to do things like this, and why wouldn't it?

Re: destruct

Posted: Tue Jul 06, 2010 10:02 am
by AbraCadaver
The connection closes at the end of the script anyway, so it's kind of redundant. __destruct() is mainly used to do some cleanup or something when an object is destroyed.