LonghornPHP 2026

ReflectionFunction::export

(PHP 5, PHP 7)

ReflectionFunction::exportExporta una función

Advertencia

Esta función está OBSOLETA a partir de PHP 7.4.0, y ha sido ELIMINADA a partir de PHP 8.0.0. Depender de esta función está altamente desaconsejado.

Descripción

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

Exporta una función reflejada.

Parámetros

name

La reflexión a exportar.

return

Definirlo a true retornará la exportación en lugar de emitirla. Definirlo a false (por defecto) hará lo contrario.

Valores devueltos

Si el parámetro return se establece a true , entonces la exportación se devuelve como un string , de lo contrario se devuelve null .

Véase también

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes 1 note

up
1
hytest at gmail dot com
14 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 ]
 }
}
+add a note

AltStyle によって変換されたページ (->オリジナル) /