What is the difference between self and $this?

  • Self is used to access static members of the class
  • Self refers to the current class
  • $this refers to the current object
  • $this can be used to call static functions
  • $this should not be used to call static member variables
  • $this can’t be used inside of static function

Leave a Reply

Your email address will not be published. Required fields are marked *