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

    (PHP 5, PHP 7)

    Exports function

    说明

    publicstaticReflectionFunction::export(string $name[,string $return]): string

    Exports a Reflected function.

    参数

    $name

    导出的反射。

    $return

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

    返回值

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

    参见

    • ReflectionFunction::invoke() Invokes function
    Example:
    <?php
    function title($title, $name)
    {
      return sprintf("%s. %s\r\n", $title, $name);
    }
    echo ReflectionFunction::export('title',true);
    ?>
    Output:
    Function [ <user> function title ] {
     @@ /path/to/file.php 2 - 5
     - Parameters [2] {
      Parameter #0 [ <required> $title ]
      Parameter #1 [ <required> $name ]
     }
    }