Hi everyone,
I read an article on how to code php efficiently and speedup execution and there its written that its a good practice to unset all the local variables as it will free the memory.
correct me if i am wrong? we can unset vars in the following ways:
$myvar1=$myvar2=$myvar3=null;
OR
unset($myvar1);
unset($myvar2);
so if i have 20 or 30 variables inside then how to unset those?
after few research i have got a build in php function get_defined_vars which lists all the variables.
is there any smart approach?
with thanks