欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

php 之对象工具

程序员文章站 2022-04-15 21:49:05
...

class_exists检查类是否已定义,如果类存在返回true

get_class返回对象的类名

get_class_methods返回由类的方法名组成的数组

get_declared_classes返回由已定义类的名字所组成的数组

is_callable检测参数是否为合法的可调用结构

method_exists检查类的方法是否存在

    bool method_exists ( mixed $object , string $method_name )

    检查类的方法是否存在于指定的 object中。

get_class_vars返回由类的默认属性组成的数组(只显示public属性)

    array get_class_vars ( string $class_name )

    返回由类的默认公有属性组成的关联数组,此数组的元素以 varname => value 的形式存在。

get_parent_class返回对象或类的父类名

is_subclass_of如果此对象是该类的子类,则返回 TRUE

call_user_funcCall the callback given by the first parameter

call_user_func_arrayCall a callback with an array of parameters

flectionClass 类报告了一个类的有关信息。

Reflection::exportExports