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

參見

add a note add a note

User Contributed Notes 1 note

up
1
hytest at gmail dot com
12 years ago
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 ]
  }
}
To Top