class_parents
(PHP 5)
class_parents --
Return the parent classes of the given class
说明
array
class_parents ( mixed class )
This function returns an array with the name of the parent classes of
the given class.
参数
- class
An object or a string of the class
返回值
Returns an array or FALSE on error.
例
例子 1. class_parents() example
<?php
class foo { } class bar extends foo {}
print_r(class_parents(new bar));
?>
|
上例将输出: |