ReflectionFunction::export

(PHP 5, PHP 7)

ReflectionFunction::exportExports function

Aviso

Esta função está OBSOLETA desde o PHP 7.4.0 e foi REMOVIDA desde o PHP 8.0.0. Depender dessa função é altamente desencorajado.

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 add a note

User Contributed Notes 1 note

up
0
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