Reflection--映像

Reflection--映像

Table of Contents

内容目录

Introduction

介绍

 

       PHP 5 comes with a complete reflection API that adds the ability to reverse-engineer classes, interfaces, functions and methods as well as extensions. Additionally, the reflection API also offers ways of retrieving doc comments for functions, classes and methods.

       PHP 5 提供了一个完整的反转类、接口、函数和方法还有扩展类的API.映射API还提供了为函数、类和方法弥补注释文档的方法。

       The reflection API is an object-oriented extension to the Zend Engine, consisting of the following classes:

       映射API是一个对Zend引擎的面向对象的扩展,看一下下面的类:

      

 

 

Note : For details on these classes, have a look at the next chapters.

注意:对与这些类的详细解释,需要看下一篇文章

 

If we were to execute the code in the example below:

如果我们执行了下面的代码:

 

将会输出:

 

Reflector

映射器(反射器)


Reflector is an interface implemented by all exportable Reflection classes.

映射器是所有映射类输出的一个接口实现

 

ReflectionException

映射例外


ReflectionException extends the standard Exception and is thrown by Reflection API. No specific methods or properties are introduced.

映射例外是由映射API抛出的对标准例外的扩展。没有引入具体的方法和属性。

ReflectionFunction

映射函数


The ReflectionFunction class lets you reverse-engineer functions.

映射函数类让你有了反转引擎函数。

 

 

To introspect a function, you will first have to create an instance of the ReflectionFunction class. You can then call any of the above methods on this instance.

为了内省一个函数,首先你需要去建立一个映射类的实例。然后你就可以调用这个实例里的任何方法了。

 

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值