1.

Which magic method is used to implement overloading in PHP?(a) __call(b) __invoke(c) __wakeup(d) __unsetI have been asked this question by my college professor while I was bunking the class.This intriguing question originated from Advanced Object-Oriented PHP topic in division Object-Oriented PHP of PHP

Answer»

The correct ANSWER is (a) __call

Best explanation: When a class IMPLEMENTS __call(), then an object of that class is called with a method that doesn’t EXIST, __call() is called INSTEAD.



Discussion

No Comment Found

Related InterviewSolutions