You are here: Re: bug or feature? (OO design/languages) « PHP Programming Language « IT news, forums, messages
Re: bug or feature? (OO design/languages)

Posted by Janwillem Borleffs on 09/18/05 01:22

Janwillem Borleffs wrote:
> class MyClass2 {
> var $x = 2;
> static $y;
>
> function __construct() {
> $this->y = $this->x;
> }
> }
>

Bad example as $y is set as a normal class property instead of a static. In
general, statics should be assigned with hardcoded values if you want to
access them directly without creating an instance of the class first.


JW

 

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

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