1.

What will be the output if a protected method is given as the argument to the function method_exist()?(a) Method does not exist(b) False(c) Error(d) TrueI got this question in an online quiz.I'm obligated to ask this question of Object Tools in portion Object Tools and Design and Variables in PHP of PHP

Answer»

The correct choice is (d) True

Easiest explanation: 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.



Discussion

No Comment Found

Related InterviewSolutions