Re: destructor not called for static members?

From: Date: Thu, 10 Mar 2005 12:25:38 +0000
Subject: Re: destructor not called for static members?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-210430@lists.php.net to get a copy of this message
Robert Janeczek wrote:
YaronKh@clalit.org.il wrote:
Hi It is an expected behavior because when you define a static variableit is shared by all objects of the same class. If When you unset one object and the destruct of the static object will be called, all the other objects will lose the static var as well.
yes, but why destuctor isn`t called after all the execution is finished? i mean the moment when php does clean up before it finishes to process request?
oh boy this is tricky water, you might want to search the php-internals archive for threads where this is discussed in some detail - in short: don't expect anything to output at shut down time. and don't rely on objects/resources existing if a dtor is called when php is cleaning up. basically you can't rely on much at all in a dtor if you are letting php call the dtor at 'shutdown' (sorry if my terminology is off rgd the termination process of a php instance)
rash


« previous php.general (#210430) next »