PHP 类相关函数的使用详解
php  /  管理员 发布于 7年前   173
bool class_alias ( string $original , string $alias [, bool $autoload = TRUE ] ) ― 为一个类创建别名
bool class_exists ( string $class_name [, bool $autoload ] )― 检查类是否已定义
string get_called_class ( void ) ―获取静态方法调用的类名
复制代码 代码如下:
class foo {
static public function test(){
var_dump(get_called_class());
}
}
class bar extends foo {}
foo::test();
bar::test();
array get_class_methods ( mixed $class_name )― 返回由类的方法名组成的数组
array get_class_vars ( string $class_name )― 返回由类的默认属性组成的数组
string get_class ([ object $obj ] )― 返回对象的类名
array get_declared_classes ( void )― 返回当前脚本中已定义类的名字组成的数组
array get_declared_interfaces ( void )― 返回当前脚本中所有已声明的接口的名字数组
array get_object_vars ( object $obj )― 返回由对象属性组成的关联数组
string get_parent_class ([ mixed $obj ] )― 返回对象或类的父类名
bool interface_exists ( string $interface_name [, bool $autoload ] )― 检查接口是否已被定义
bool is_a ( object $object , string $class_name )― 如果对象属于该类或该类是此对象的父类则返回 TRUE
bool is_subclass_of ( object $object , string $class_name )― 检测对象是该类的子类实例化得到的
bool method_exists ( object $object , string $method_name )― 检查类的方法是否存在
bool property_exists ( mixed $class , string $property ) ― 检查对象或类是否具有该属性您可能感兴趣的文章:
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号