You are here: Reference to THIS from inside constructor « PHP Programming Language « IT news, forums, messages
Reference to THIS from inside constructor

Posted by Tamagafk on 02/01/07 14:55

Hi there,
I heard storing reference to THIS from inside object's constructor can
cause problems:

$myObjects = array();
class MyClass{
function MyClass(){
global $myObjects;
$myObjects[] = $this;
}
}

Do you know anything about that? It looks like when constructor
finishes all such references lead to COPY of the object.

 

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

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