The ReflectionParameter class

(PHP 5, PHP 7, PHP 8)

Introduzione

The ReflectionParameter class retrieves information about function's or method's parameters.

To introspect function parameters, first create an instance of the ReflectionFunction or ReflectionMethod classes and then use their ReflectionFunctionAbstract::getParameters() method to retrieve an array of parameters.

Sommario della classe

class ReflectionParameter implements Reflector {
/* Proprietà */
public string $name;
/* Metodi */
public __construct(string|array|object $function, int|string $param)
public allowsNull(): bool
private __clone(): void
public static export(string $function, string $parameter, bool $return = ?): string
public getAttributes(?string $name = null, int $flags = 0): array
public getName(): string
public getPosition(): int
public hasType(): bool
public isOptional(): bool
public isPromoted(): bool
public isVariadic(): bool
public __toString(): string
}

Proprietà

name

Name of the parameter. Read-only, throws ReflectionException in attempt to write.

Log delle modifiche

Versione Descrizione
8.0.0 ReflectionParameter::export() was removed.

Indice dei contenuti