get_parent_class() function returns the name of the parent class. : get_parent_class « Reflection « PHP
- PHP
- Reflection
- get_parent_class
get_parent_class() function returns the name of the parent class.
The syntax is: string get_parent_class(object objname);
<?
class Vehicle {
}
class Car extends Vehicle {
}
$car = new Car;
$parent = get_parent_class($car);
print_r($parent);
?>
Related examples in the same category