1.

Which one of the following variable cannot be used inside a static method?(a) $this(b) $get(c) $set(d) $dateThis question was posed to me in quiz.My doubt is from Object Advanced Features in chapter Objects and Databases in PHP of PHP

Answer»

The correct choice is (a) $this

The explanation: By definition, static methods are not invoked in the CONTEXT of an object. For this reason, static methods and properties are often REFERRED to as CLASS variables and properties.



Discussion

No Comment Found

Related InterviewSolutions