1.

Which version of PHP introduced the instanceof keyword?(a) PHP 4(b) PHP 5(c) PHP 5.3(d) PHP 6I had been asked this question during an interview for a job.Question is from Basics of Object-Oriented PHP- 2 topic in portion Object-Oriented PHP of PHP

Answer»

Correct answer is (B) PHP 5

Explanation: Using instanceof keyword we can determine WHETHER an object is an instance of a CLASS. $manager = new Employee() … if ($manager instanceof Employee) ECHO “True”;



Discussion

No Comment Found

Related InterviewSolutions