ReflectionFunction::export

(PHP 5, PHP 7)

ReflectionFunction::exportExports function

Aviso

Esta função tornou-se OBSOLETA a partir do PHP 7.4.0 e foi REMOVIDA a partir do PHP 8.0.0. O uso desta função é altamente desaconselhado.

Descrição

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

Exports a Reflected function.

Parâmetros

name

A reflexão para exportar.

return

Passar true irá retornar o export, em vez de emiti-lo. Passar false (padrão) fará o oposto.

Valor Retornado

Se o parâmetro return for true então o export é retornado como uma string, senão retorna null.

Veja Também

add a note

User Contributed Notes 1 note

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