1.

Which one of the following function should I use to find the parent class of a class?(a) get_parent_class()(b) parent_class()(c) class_parent()(d) get_class_parent()The question was asked in class test.My question is based upon Object Tools topic in chapter Object Tools and Design and Variables in PHP of PHP

Answer»

Right answer is (a) get_parent_class()

Easiest EXPLANATION: The class functions also allow US to chart INHERITANCE relationships.This function requires either an object or a class name, and it returns the name of the superclass, if any. If no such class exists, that is, if the class we are testing does not have a parent, then the function returns FALSE.



Discussion

No Comment Found

Related InterviewSolutions