PHP » PYTHON |
login |
register |
about
|
PYTHON get_parent_class
is this article helpful?
|
Python replacement for PHP's get_parent_class
[
edit
| history
]
# for classes: myClass.__bases__ # Note the plural. Python supports multiple inheritance, so this is a tuple # for objects: type(myObj).__bases__ get_parent_class(PHP 4, PHP 5) get_parent_class — Retrieves the parent class name for object or class DescriptionRetrieves the parent class name for object or class. Parameters
Return ValuesReturns the name of the parent class of the class of which object is an instance or the name.
If called without parameter outside object, this function returns FALSE. Changelog
Examples
Example #1 Using get_parent_class()
<?php The above example will output: I'm dad's son I'm dad's son too
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|