Class deconstructors?
Posted: Thu Apr 15, 2004 7:00 am
Hi there
I have a bit of a problem...or question, please help if you can...
Basically lets say you create a class that in its constructor creates a DB connection. Now theoretically in other languages you would have to close that connection at some point to prevent hassles. It strikes me that the best place to do this would be in the deconstructor...BUT of course PHP doenst have a deconstructor.
How / What is the best way to do this in PHP? I do need to close that connection correct? Where would you suggest I do that?
AND does PHP have overloading of functions?
Thanks a mill.
I have a bit of a problem...or question, please help if you can...
Basically lets say you create a class that in its constructor creates a DB connection. Now theoretically in other languages you would have to close that connection at some point to prevent hassles. It strikes me that the best place to do this would be in the deconstructor...BUT of course PHP doenst have a deconstructor.
How / What is the best way to do this in PHP? I do need to close that connection correct? Where would you suggest I do that?
AND does PHP have overloading of functions?
Thanks a mill.