文字

ReflectionFunction::export

(PHP 5)

ReflectionFunction::exportExports function

说明

public static string ReflectionFunction::export ( string $name [, string $return ] )

Exports a Reflected function.

参数

name

导出的反射。

return

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

返回值

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

参见

  • ReflectionFunction::invoke() - Invokes function

用户评论:

[#1] hytest at gmail dot com [2011-11-22 08:04:05]

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 ]
  }
}

上一篇: 下一篇: