take this simple loop
while(1) {
$data = file_get_contents('randomfiles.img');
$resource = imagecreatefromstring($data);
//> do some image operation and other stuff
//> continue
//> not calling imagedestroy($resource);
}
As you can see, I did not call imagedestroy, but I use the same variable ($ resource) to store input imagecreatefromstring();(resource type)
When a new loop starts php GC, automatically delete the previous one $resource?
Consider only PHP 5.3+
thank
anon
source
share