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

Posted by Thomas Mlynarczyk on 11/16/06 16:27

Also sprach Jerry Stuckle:

> It doesn't make any difference what order the functions are in - they
> are only called when your code calls them directly or indirectly
> (i.e. a constructor). So whatever order you call them in is the way
> they will be called.

But I am not /calling/ these functions - it is PHP that decides when to call
them. I am merely registering two functions and instantiating an object.

> As for the variable - the object is destroyed, the destructor is
> called. But that's not what's happening here. You are calling the
> destructor, so it acts just like any other function.

Where am *I* calling the destructor in my code? I am merely /defining/ the
function __destruct() and I leave it up to PHP to decide when it is to be
executed.

> Rather, the destructor is called implicitly during script termination
> or when the variable goes out of scope. Like a constructor, you
> should not be calling a destructor.

But I am not calling it! Where in my code do I have a line that says
"$o->__destruct();"?

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

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