Wow, this entry is getting a lot of traffic from DZone and other places. If you like this post, be sure to check out New Year’s Benchmarks for PHP framework comparisons, and the Solar Framework for PHP 5. Thanks for visiting!
One of the nice things about using a scripting language is that it automates garbage collection for you. You don’t have to worry about releasing memory when you’re done with your variables. As each variable passes out of scope, PHP frees that memory for you. If you want to, you can free the memory yourself using
unset(), but usually you don’t have to.
But there is at least one circumstance in which PHP will not free memory for you when you call
unset(). Cf. http://bugs.php.net/bug.php?id=33595.
…. interesting post from Paul M. Jones, see the complete post here.