|
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]
|