phpday 2027 - Call for Papers

ReflectionFunction::export

(PHP 5, PHP 7)

ReflectionFunction::export — Exports function

Avviso

Questa funzione è stata DEPRECATA a partire da PHP 7.4.0 e RIMOSSA a partire da PHP 8.0.0. Fare affidamento su questa funzione è altamente sconsigliato.

Descrizione

public static function ReflectionFunction::export(string $name, string $return = ?): string

Exports a Reflected function.

Elenco dei parametri

name

La reflection da esportare.

return

Impostandolo a true l'esportazione verrà restituita, invece di essere emessa. Impostandolo a false (il valore predefinito) si otterrà il contrario.

Valori restituiti

Se il parametro return è impostato a true, l'esportazione viene restituita come string, altrimenti viene restituito null.

Vedere anche:

+add a note

User Contributed Notes 1 note

up
1
hytest at gmail dot com
15 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