Re: unset( $anobject) does not invoce __destruct()

Re: unset( $anobject) does not invoce __destruct()

am 24.08.2009 15:32:22 von Luke

--00151747b76e6978710471e33f69
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

2009/8/24 Ralph Deffke

> typing error sorry
>
> forget my last post
>
> is there a was to destroy an object if there is hold a reference somewhere?
>
> "Stuart" wrote in message
> news:a5f019de0908240606x5fdca70bkb31dd32b072e52b6@mail.gmail .com...
> > 2009/8/24 kranthi :
> > > unset($obj) always calls the __destruct() function of the class.
> > >
> > > in your case clearly you are missing something else. Probably
> > > unset($anobject) is not being called at all ?
> >
> > That's not entirely correct. PHP uses reference counting, so if
> > unsetting a variable did not cause the object to be destructed then
> > it's highly likely that there is another variable somewhere that is
> > holding a reference to that object.
> >
> > -Stuart
> >
> > --
> > http://stut.net/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Then I assume you would have to copy the object into another variable rather
than reference the one you are trying to destroy?

--
Luke Slater
:O)

this text is protected by international copyright. it is illegal for
anybody apart from the recipient to keep a copy of this text.
dieser text wird von internationalem urheberrecht geschuetzt. allen
ausser dem/der empfaenger/-in ist untersagt, eine kopie dieses textes
zu behalten.

--00151747b76e6978710471e33f69--