oop - What is the difference between self and $this in php? -
this question has answer here:
- when use self on $this? 21 answers
what difference between $this
, self
? when should use each of them?
$this
refers current instance. self
refers current class.
in other words, can use $this->somemember
refer instance member , self::$somestaticmember
refer static member.
Comments
Post a Comment