Query: class_parents
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
CLASS_PARENTS(3) 1 CLASS_PARENTS(3) class_parents - Return the parent classes of the given classSYNOPSISarray class_parents (mixed $class, [bool $autoload = true])DESCRIPTIONThis function returns an array with the name of the parent classes of the given $class.PARAMETERSo $class - An object (class instance) or a string (class name). o $autoload - Whether to allow this function to load the class automatically through the __autoload(3) magic method.RETURN VALUESAn array on success, or FALSE on error.CHANGELOG+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.1.0 | | | | | | | Added the option to pass the $class parameter as | | | a string. Added the $autoload parameter. | | | | +--------+---------------------------------------------------+EXAMPLESExample #1 class_parents(3) example <?php class foo { } class bar extends foo {} print_r(class_parents(new bar)); // since PHP 5.1.0 you may also specify the parameter as a string print_r(class_parents('bar')); function __autoload($class_name) { require_once $class_name . '.php'; } // use __autoload to load the 'not_loaded' class print_r(class_parents('not_loaded', true)); ?> The above example will output something similar to: Array ( [foo] => foo ) Array ( [parent_of_not_loaded] => parent_of_not_loaded )SEE ALSOclass_implements(3). PHP Documentation Group CLASS_PARENTS(3)
Related Man Pages |
---|
get_class(3) - php |
var_export(3) - php |
get_class_methods(3) - php |
class_alias(3) - php |
is_a(3) - php |
Similar Topics in the Unix Linux Community |
---|
TCPDF 2.0.000_PHP4 (PHP4 branch) |
TCPDF 2.0.000 (PHP5 branch) |
TCPDF 2.2.003 (PHP5 branch) |
TCPDF 2.2.004 (PHP4 branch) |
How to load different type of data in a file to two arrays |