I know there are a lot of information according to this, but I couldn't find any really useful and understandable. So what is the difference between public static function
and public function
? Why sometimes I have to use the word static
?
I know that static functions are called by ::
and non-static by ->
, but the real difference (why sometimes I should use static
I don't get). As I understand now, when I use static
, I can call it from another class. Without it - I cannot. But I'm pretty sure that I'm wrong.
I think this information would be really helpful for a lot of ppl. Thanks for your time in trying to explain it.