|
Posted by Rik on 01/13/07 10:38
Sanders Kaufman wrote:
> Rik wrote:
>> Sanders Kaufman wrote:
>
>>>>> What does "::" mean?
>>>>> Is that a shortcut for "->"?
>
>>>> No, it is the Scope Resolution Operator
>>>> http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php
>
>>> I read that, but I'm still a little confused.
>>> When I use a class's methods and such, I've been using "->".
>>> But it seems like this "::" is used the same way.
>>> What's the difference?
>>
>> Simplified: it's the difference between objects and classes.
>
> Two part question here:
>
> [1]
> OK - but on a more practical level, what's the difference.
> I mean -like, in my code I'll create a class.
> In that class, I'll reference it's members with "$this->member".
> Then, somewhere else I'll create an object based on the class
> and reference it's members with "$class->member".
>
> Where would I use "::"?
You wouldn't, as it are all objects, and not classes. You'd only need it if
your class extended another class and you wished to call a parents method.
http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php
--
Rik Wasmus
Navigation:
[Reply to this message]
|