Most resources on PHP never touch memory management because the language itself is pretty good at doing this for you. However, in PHP you often end up dealing with external
Slightly offtopic: you can do a using-like pattern with lambdas. Like this:
function WithFile($Name, $Func)
{
$File = fopen($Name, 'r');
$r = $Func($File);
fclose($File);
return $r;
}
And then use it like this
$FileHeader = WithFile('myfile', function($File) {return fread($File, 16);});
Perfectly deterministic. That said, were there a terser syntax for lambdas...