资源上的PHP垃圾收集器?
采取这个简单的循环
while(1) { $data = file_get_contents('randomfiles.img'); $resource = imagecreatefromstring($data); //> do some image operation and other stuff //> continue //> not calling imagedestroy($resource); } 正如你所看到我没有调用imagedestroy,但我使用相同的变量($resource)来存储imagecreatefromstring()的输入; (类型资源) 当一个新循环启动时,php GC自动释放以前的$资源? 我们只考虑PHP 5.3 谢谢 解决方法
从
http://de2.php.net/manual/en/language.types.resource.php起
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |