get_parent_class

string get_parent_class(object obj) 

Finds the parent class of an object.

Returns:

Name of the parent class; FALSE if obj is not an object

Description:

get_parent_class() returns the name of the parent class of an object. In other words, if the specified object is an instance of a class that extends another class, get_parent_class() returns the name of the class that’s being extended.

If obj is not an object, the function returns FALSE.

Availability:

UNIX, Windows

Version:

4.0b2+

See also:

is_subclass_of() 

Example:

Find the parent class of an object
 class vehicle { var $passenger_num; var $power_source; var $travel_medium; } class jinrikisha extends vehicle { var $wheels = 2; function jinrikisha () { $this->passenger_num ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.