Reply to Re: imagedestroy and similar

Your name:

Reply:


Posted by ljb on 04/20/07 00:48

andre@webkr.de wrote:
> Hi,
>
> is there a difference between imagedestroy($ih) and unset($ih)?
>
> The same with other similar functions like closedir, mysql_close,
> curl_close, mysql_free_result, etc.
>
> And by the way... will the garbage collector even detect an "implicit
> unset" when a resource is used for the last time?

In the case of GD, I think imagedestroy does nothing more than unset. But
you probably should not assume that in general. If the resource is properly
implemented, then yes unsetting it should do all the necessary cleanup.

The garbage collector does not detect when a resource is used for the last
time. It does detect when it goes out of scope. For example, a resource
variable local to a function ... when the function returns, the resource
should be cleaned up.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация