Reply to Re: Reassigning variable to new object destroys old one?

Your name:

Reply:


Posted by Tyno Gendo on 04/30/07 16:43

ZeldorBlat wrote:
> The object is automatically destroyed when nothing is referencing it.
> When you assign the second instance to $x, there is nothing left
> referencing the first instance.
>
> There was another thread on this subject recently:
> <http://groups.google.com/group/comp.lang.php/browse_frm/thread/
> 7046181c4c507263/3e766edeeebbd5f5#3e766edeeebbd5f5>
>

At the risk of starting the $a++ thread again ... hehe

I believe that will be why $a = $a++; doesn't work.

The PHP manual should say $a++ "Returns value of $a" not "Returns $a..."
which to me infers it returns itself as a reference and the ++ should work.

But, returns value of a, hence $a overwrites itself, and the ++ tries to
take effect on the original which now has no references so doesn't exist.

Umm... Monday afternoon.. I'm bored and perplexed at the same time.

I don't think that helped you, sorry. I'll get my coat.

[Back to original 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

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