ReflectionFunction::export()
(PHP 5, PHP 7)
Exports function
说明
public static ReflectionFunction::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 ] } }