|
Posted by Sanders Kaufman on 01/13/07 10:26
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 "::"?
[2]
Perhaps I would understand better if I understood what is meant
by the phrase "scope resolution operator".
So why is it called that?
Maybe more specifically, what does "resolution" mean in this
context?
[Back to original message]
|