I've started using "unset($variable)" at the end of my scripts for almost all variables (definitely database related)... Just wondering if everyone else does this, or if it's even needed...
You only really need to use unset() when you want variables to be destroyed. Well, if they contain really big values it might be worth considering as well. But besides these two cases, it's not needed.
Aye, PHP's auto-garbage handling should destroy most variables for you. It's wise to close handles like file-pointers, db connections, and images (with the GD library). These could cause errors if they're not closed properly, or they could cause large memory leaks (in the case of images). For regular variables, though, I rely pretty much on PHP to do the garbage collection and destroy all the variables. - Walkere