Vidyalelo
PHP · Q91

Object Oriented Concept

Programming · PHP · question 91

Q91

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

Answer: Option D

Solution

Answer: Option D
Solution:
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.