(PHP 5, PHP 7, PHP 8)
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.
public allowsNull(): bool
public canBePassedByValue(): bool
private __clone(): void
public static export(string $function, string $parameter, bool $return = ?): string
public getAttributes(?string $name = null, int $flags = 0): array
#[\Deprecated] public getClass(): ?ReflectionClass
public getDeclaringClass(): ?ReflectionClass
public getDeclaringFunction(): ReflectionFunctionAbstract
public getDefaultValue(): mixed
public getDefaultValueConstantName(): ?string
public getName(): string
public getPosition(): int
public getType(): ?ReflectionType
public hasType(): bool
#[\Deprecated] public isArray(): bool
#[\Deprecated] public isCallable(): bool
public isDefaultValueAvailable(): bool
public isDefaultValueConstant(): bool
public isOptional(): bool
public isPassedByReference(): bool
public isPromoted(): bool
public isVariadic(): bool
public __toString(): string}
Name of the parameter. Read-only, throws ReflectionException in attempt to write.
| Version | Description |
|---|---|
| 8.0.0 | ReflectionParameter::export() was removed. |
© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/class.reflectionparameter.php