You are here: Re: Parent Objects « PHP Programming Language « IT news, forums, messages
Re: Parent Objects

Posted by Rik on 01/13/07 11:34

Sanders Kaufman wrote:
> Toby Inkster wrote:
>
>> <?php
>> include "Widget.class.php";
>> echo Widget::FOO;
>>>
>>
>> Versus:
>>
>> <?php
>> include "Widget.class.php";
>> $my_widget = new Widget();
>> echo $my_widget->FOO;
>>>
>
>
> It means that I can call the CLASS method, without
> instantiating(?) an object, right?
>
> Man, oh man, that could be real handy for my classes that don't
> do too much stuff in the constructor!
>
> Wait... I guess I shouldn't assume here. So I'll ask - when I
> call a class method with "::", it won't fire up the constructor,
> will it?

It won't, and furthermore, $this will not available. For most cases, you
can use self::
--
Rik Wasmus

 

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

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