PHP Test online


10. How would you call the mymethod method of a class within the class itself?


Вариант ответа 1 - A) $self=>mymethod();

Вариант ответа 2 - B) $this->mymethod();

Вариант ответа 3 - C) $current->mymethod();

Вариант ответа 4 - D) $this::mymethod();

Вариант ответа 5 - E) None of the above are correct


Comments: In PHP, methods and properties of a class’ current instance are accessed from within its methods using the $this special variable.

Comments

User nameComment
User name
Comment text
Code