• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • ReflectionMethod::export()

    (PHP 5, PHP 7)

    输出一个回调方法

    说明

    publicstaticReflectionMethod::export(string $class, string $name[,bool $return= false] ): string

    Exports a ReflectionMethod.

    Warning

    本函数还未编写文档,仅有参数列表。

    参数

    $class

    类名称

    $name

    方法名称

    $return

    设为TRUE时返回导出结果,设为FALSE(默认值)则忽略返回。

    返回值

    如果参数$return设为TRUE,导出结果将作为string返回,否则返回NULL

    参见

    • ReflectionMethod::__construct() ReflectionMethod 的构造函数
    • ReflectionMethod::__toString() 返回反射方法对象的字符串表达
    //
      $instance = new ReflectionClass($namespace);
      $method = $instance->getMethod($method_name);
      // need to prove 
      $method->export(
        $method->class, // necessary ?
        $method->name // necessary ?
      );