Search Results
Return Values ¶ Returns the name of the parent class of the class of which object_or_class is an instance or the name. If the object does not have a parent or the given class does not exist, false will be returned.
You don't need to wait for PHP 5.3 if you're able to conceive of a way to do this outside of a static context. In php 5.2.9, in a non-static method of the parent class, you can do:
Description string get_parent_class ( [mixed obj] ) If obj is an object, returns the name of the parent class of the class of which obj is an instance. If obj is a string, returns the name of the parent class of the class with that name. This functionality was added in PHP 4.0.5.
The PHP Class/Object get_parent_class() function is used to return the name of the parent class for a particular object or class. It determines the superclass from which the class or object inherits and returns false if no parent class exists.
PHP 4, PHP 5, PHP 7, PHP 8 get_parent_class - Retrieves the parent class name for object or class Manual Code Examples
Si l'objet n'a pas de parent ou si la classe fournie n'existe pas, false sera retourné. Si appelée sans paramètre en dehors d'un objet, cette fonction retourne false.
The get_parent_class function returns the name of the parent class for the specified object or class. Let's explore its features with examples.
