In PHP 5, what is the difference between using self
and $this
?
When is each appropriate?
According to http://www.php.net/manual/en/language.oop5.static.php there is no $self
. There is only $this
, for referring to the current instance of the class (the object), and self, which can be used to refer to static members of a class. The difference between an object instance and a class comes into play here.