PHP - Classes and Objects
Which of the following is the correct way to call a method named
greet inside a PHP class using $this?greet inside a PHP class using $this?-> with $this representing the current object.$this->greet(); is the correct syntax. The other options use invalid syntax.$this->greet(); -> Option D$this->method(); [OK]$this->methodName(); to call methods inside class [OK]$thisself without scope resolution operator15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions