In PHP, the $this keyword is used to refer to the ______ instance of the class.

  • Current
  • Object
  • Parent
  • Static
In PHP, the $this keyword is used to refer to the current instance of the class. It allows access to the properties and methods of the object within the class. The correct option is "Current." The $this keyword is used to differentiate between class members and local variables or parameters with the same name. For further details, refer to the PHP documentation on the $this keyword: http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.this
Add your answer
Loading...

Leave a comment

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