这些函数允许您获取有关类和实例对象的信息。您可以获取对象所属的类的名称,以及其成员属性和方法。
php-表示支持该函数的php的最早版本。
链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-class-object-functions.html
来源:LearnFk无涯教程网
Sr.No | Function & Description | PHP |
---|---|---|
1 |
call_user_method_array() 使用参数组调用给定的User方法[不建议使用] |
4 |
2 |
call_user_method() 对特定对象调用用户方法[已弃用] |
4 |
3 |
class_exists()
检查是否已定义类 |
4 |
4 |
get_class_methods()
获取类方法的名称 |
4 |
5 |
get_class_vars()
获取类的默认属性 |
4 |
6 |
get_class()
返回对象的类的名称 |
4 |
7 |
get_declared_classes()
返回具有已定义类的名称的数组 |
4 |
8 |
get_declared_interfaces()
返回所有已声明接口的数组 |
5 |
9 |
get_object_vars()
获取给定对象的属性 |
4 |
10 |
get_parent_class()
检索对象或类的父类名称 |
4 |
11 |
interface_exists()
检查是否已定义接口 |
5 |
12 |
is_a()
检查对象是否属于此类或将此类作为其父对象之一 |
4 |
13 |
is_subclass_of ()
检查对象是否将此类作为其父对象之一 |
4 |
14 |
method_exists()
检查类方法是否存在 |
4 |
15 |
property_exists()
检查对象或类是否具有属性 |
5 |
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)