You are here: Re: classes and variable scope « PHP Programming Language « IT news, forums, messages
Re: classes and variable scope

Posted by ZeldorBlat on 11/05/05 23:35

That's fine but it's worth noting that, once myClass has been
instantiated, any changes to $myvar in the global scope will not be
reflected in the member variable of the object. This can be changed by
changing:

$this -> mystr = $myvar;

in the constructor to:

$this->mystr =& $myvar;

I think that should work -- although I didn't test it.

 

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

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