php man page for class_parents

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 class

SYNOPSIS
array class_parents (mixed $class, [bool $autoload = true])
DESCRIPTION
This function returns an array with the name of the parent classes of the given $class.
PARAMETERS
o $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 VALUES
An 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. | | | | +--------+---------------------------------------------------+
EXAMPLES
Example #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 ALSO
class_implements(3). PHP Documentation Group CLASS_PARENTS(3)
Related Man Pages
var_export(3) - php
get_class_methods(3) - php
class_alias(3) - php
is_a(3) - php
uopz_compose(3) - php
Similar Topics in the Unix Linux Community
TCPDF 2.2.003 (PHP5 branch)
TCPDF 2.6.000 (PHP5 branch)
How to load different type of data in a file to two arrays
php class
Added &quot;Moderated Tags&quot; to Moderating Stats