PHP Conference Fukuoka 2025

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á fuertemente desaconsejado.

Descripción

public static 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 omisión) hará lo contrario.

Valores devueltos

Si el parámetro return está definido a true, la exportación será retornada en forma de string, de lo contrario, null será retornado.

Ver también

add a note

User Contributed Notes 1 note

up
0
hytest at gmail dot com
13 years ago
Example:<?phpfunction 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