Hi,
A very basic question as I said.
What's the difference between "Class::Page()" and "$class->Page()" ?
Also what kind of benefits do I get by using $this? (Computer related benefits like performance.)
It will be good if you can explain these detailed.
Thanks.
Basic Class Question
Moderator: General Moderators
Re: Basic Class Question
Class::Page() is a call to a static method. Static methods are methods of a class and not of it's instance, and generally they have no state (or at least should not).
$this->Page() is a call to a method of the instance. It makes a lot of difference if you have polymorphism as it call the method of the current instance, which can be any subclass of Class.
I suggest you to google and read about static methods, hiding/minimizing state and polymorphism
$this->Page() is a call to a method of the instance. It makes a lot of difference if you have polymorphism as it call the method of the current instance, which can be any subclass of Class.
I suggest you to google and read about static methods, hiding/minimizing state and polymorphism