The code illustrates better what I\'m asking:
function foo(){ $var = get_huge_amount_of_data(); return $var[0]; } $s = foo(); // is memory freed her
Yes it is because $var is declare on stack and get clear as soon it goes out of scope
$var
You can refer this https://stackoverflow.com/a/5971224/307157