You are here: Re: _sleep and _wakeup « PHP Programming Language « IT news, forums, messages
Re: _sleep and _wakeup

Posted by Water Cooler v2 on 06/18/06 18:41

Chung Leong wrote:

> You misunderstood I'm afraid. IDisposable.Dispose called, if I remember
> my .NET correctly, when an object is garbage collected. __sleep() is
> called when an object is serialized--usually at the end of the request
> when PHP saves session data to a file. Its main purpose is to let PHP
> know what properties within the object should be saved and what
> shouldn't be (cached records for instance). The __wakeup() method is
> the inverse of that--called when PHP restore data previously stored in
> a file into an object.
>
> __destruct() is the closest counter part to IDisposable.Dispose. You
> typically don't need to manually free resources, since PHP will do it
> for you at the end of a request.


Thanks, Chung. I'd understood correctly, albeit my anology was rather
amiss.

 

Navigation:

[Reply to this 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

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