Posted by Sanders Kaufman on 01/13/07 11:10
Michael Fesser wrote:
> .oO(Sanders Kaufman)
>
>> 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?
>
> $someObject->method()
> someClass::staticMethod()
>
> '->' requires an instance of a class, whereas '::' is used to call
> static class methods or constants without having an object. Additionally
> it's used to call inherited methods.
D'oh!
I thought I had it - but then you said something about static stuff.
And I think I'm futzed up about Object v. Class here.
So let's see if I've got it better this way:
I call my OBJECT methods with "->".
I call my CLASS methods with "::".
Ja?
[Back to original message]
|