1.

Which one of the following method is invoked when a value is assigned to an undefined property?(a) __get()(b) __set()(c) __isset()(d) __call()This question was addressed to me in class test.My question is from Object Advanced Features in section Objects and Databases in PHP of PHP

Answer»

Correct ANSWER is (b) __set()

Best explanation: The __set() method is INVOKED when client code attempts to assign to an undefined property. It is PASSED TWO arguments: the name of the property, and the value the client is attempting to set.



Discussion

No Comment Found

Related InterviewSolutions