Skip to content

PHP – Difference between using self and $this

$this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.

Share via
Copy link
Powered by Social Snap