加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – Reflection类是什么?

发布时间:2020-12-13 17:26:50 所属栏目:PHP教程 来源:网络整理
导读:我熟悉反射的概念(强调那些忽略这个问题的人),我知道ReflectionClass,ReflectionMethod,ReflectionObject等做了什么. 但是在查看PHP文档时,我偶然发现了Reflection类,它没有进一步的文档: The reflection class. 此类没有构造函数,没有已知的子类,并且是可
我熟悉反射的概念(强调那些忽略这个问题的人),我知道ReflectionClass,ReflectionMethod,ReflectionObject等做了什么.

但是在查看PHP文档时,我偶然发现了Reflection类,它没有进一步的文档:

The reflection class.

此类没有构造函数,没有已知的子类,并且是可实例化的.

它的目的是什么?

解决方法

看来这个类专门用于其export()方法,而不实现Reflector接口.

从PHP 5 Recipes(与a slightly annoying Google search一起):

Reflection: This class implements as a static method the export() method defined by Reflector,although it does not actually implement the Reflector interface. You can use this method to dump all the methods and/or properties of a class,extension,property,method or parameter.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读