You are here: Re: Shutdown order « PHP Programming Language « IT news, forums, messages
Re: Shutdown order

Posted by Thomas Mlynarczyk on 11/17/06 13:27

Also sprach Jerry Stuckle:


> And you can still access the object because its reference still points
> to the object. PHP will destroy the object, but will not alter the
> reference to the object. There is no need to - the reference will be
> destroyed soon, anyway.

So this is a bit like deleting a file on my harddisk - the space it occupied
is just marked as available, but as long as it is not physically overwritten
the file is still there?

> Destructors are meant to clean up the object itself - i.e. for a class
> which access a database you could want to close the database
> connection. It's never a good idea to have a destructor depend on
> the state of another object which itself may be destroyed. The same
> is true when you register a shutdown function - that function should
> not depend on the state of any objects.

In other words: I should always write my scripts to be completely
independent of the shutdown order.

Greetings,
Thomas

 

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

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