From a random php.net post:
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.
Apparently this is the undisputed truth so maybe someone would be so kind as to explain.
I mean, what, does unset
magically not execute any assembly instructions whereas $whatever = null;
does? The answer, as given, is about as useful as saying
$whatever = null resets the buffer and the L1 cache whereas unset clears the buffer and resets the L2 cache.
Techno mumbo jumbo doesn't constitute an answer.
See Question&Answers more detail:os