ReflectionFunction::export

(PHP 5, PHP 7)

ReflectionFunction::exportExports function

Opis

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

Exports a Reflected function.

Parametry

name

Refleksja do eksportu.

return

Ustawienie na TRUE zwróci eksport, zamiast go wyświetlać. Ustawienie na FALSE (domyslne), odwrotnie.

Zwracane wartości

Jeśli parametr return jest ustawiony na TRUE, eksport jest zwracany jako string, w przeciwnym przypadku jako NULL.

Zobacz też:

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