Both self and this are keywords that can be used to refer to member variables of an enclosing class. The difference is that $this->member should be used for __ members and self::$member should be used for __ members.

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
  • private, public
  • object,primitive
  • non-static,static
  • concrete,abstract
0/5 (0 Reviews)

Like this article?

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest

Related Posts