Is it true that unsetting variables
doesn't actually decrease the memory
consumption during runtime?
Yep. From PHP.net:
unset() does just what it's name says
- unset a variable. It does not force immediate memory freeing. PHP's
garbage collector will do it when it
see fits - by intention as soon, as
those CPU cycles aren't needed anyway,
or as late as before the script would
run out of memory, whatever occurs
first.
If you are doing $whatever = null;
then you are rewriting variable's
data. You might get memory freed /
shrunk faster, but it may steal CPU
cycles from the code that truly needs
them sooner, resulting in a longer
overall execution time.
Regarding your other question:
And is there any reason to unset
variables apart from destroying
session varaibles for instance or for
scoping?
Not really, you pretty much summed it.