As mentioned in unset
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.