Examveda
Examveda

What will be the output if a protected method is given as argument to the function method_exist()?

A. Method does not exist

B. False

C. Error

D. True

Answer: Option D

Solution(By Examveda Team)

method_exists() returns true for private and protected methods as well as for public ones. Remember that the fact that a method exists does not mean that it will be callable.

This Question Belongs to PHP >> Object Oriented Concept

Join The Discussion

Related Questions on Object Oriented Concept