Ok.. I have been diverted from classes for a while.. slowly getting back to tackling them.
I'm rather confused specifically with 'static methods'. I can understand making public properties static if you want to access them directly from outside a class without needing to create an object, as without the static key word, these properties rely on instantiated objects (in other words, sans-static, you cannot simply echo out a public property (say $myProperty) from a class (say myClass) as such - echo myClass::$myProperty).
Where I'm not so sure however, is when dealing with static methods... From what I can gather, so long as methods are a) not private nor protected nor final, etc.. and b), there is no pseudo variable $this involved, on the onset it would seem that it doesn't matter if they are declared static or not:
class user {
public function myFunc(){
return 'Welcome to myFunc' . "<br />\n";
}
}
echo user::myFunc();
This works, as it is public, and there is no $this placeholder (which common sense would denote the need to create an object to make use of). But whether I include the keyword static or not next to public in the above method, I will be able to call it statically it appears...
Am I sorely missing something here? I have tried finding examples that require the static keyword on a method.. perhaps I overlooked something?
Cheers