The ReflectionParameter class

(PHP 5, PHP 7, PHP 8)

Einführung

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.

Klassenbeschreibung

classReflectionParameterimplementsReflector {
public__construct(string|array|object$function, int|string$param)
publicallowsNull(): bool
private__clone(): void
publicstaticexport(string$function, string$parameter, bool$return = ?): string
publicgetAttributes(?string$name = null, int$flags = 0): array
publicgetName(): string
publicgetPosition(): int
publichasType(): bool
publicisArray(): bool
publicisCallable(): bool
publicisOptional(): bool
publicisVariadic(): bool
}

Eigenschaften

name

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

Changelog

VersionBeschreibung
8.0.0ReflectionParameter::export() was removed.

Inhaltsverzeichnis

To Top