ReflectionParameter
class ReflectionParameter implements Reflector (View source)
The ReflectionParameter class retrieves information about function's or method's parameters.
Properties
string | $name |
Methods
Construct
Exports
Returns the string representation of the ReflectionParameter object.
Gets parameter name
Checks if passed by reference
Returns whether this parameter can be passed by value
Gets declaring function
Gets declaring class
Gets the class type hinted for the parameter as a ReflectionClass object.
Checks if the parameter has a type associated with it.
Gets a parameter's type
Checks if parameter expects an array
Returns whether parameter MUST be callable
Checks if null is allowed
Gets parameter position
Checks if optional
Checks if a default value is available
Gets default parameter value
Returns whether the default value of this parameter is constant
Returns the default value's constant name if default value is constant or null
Returns whether this function is variadic
Returns information about whether the parameter is a promoted.
No description
Details
__construct(callable $function, string|int $param)
Construct
static string|null
export(string $function, string $parameter, bool $return = false)
Exports
string
__toString()
Returns the string representation of the ReflectionParameter object.
string
getName()
Gets parameter name
bool
isPassedByReference()
Checks if passed by reference
bool
canBePassedByValue()
Returns whether this parameter can be passed by value
ReflectionFunctionAbstract
getDeclaringFunction()
Gets declaring function
ReflectionClass|null
getDeclaringClass()
Gets declaring class
ReflectionClass|null
getClass()
Gets the class type hinted for the parameter as a ReflectionClass object.
bool
hasType()
Checks if the parameter has a type associated with it.
ReflectionType|null
getType()
Gets a parameter's type
bool
isArray()
Checks if parameter expects an array
bool
isCallable()
Returns whether parameter MUST be callable
bool
allowsNull()
Checks if null is allowed
int
getPosition()
Gets parameter position
bool
isOptional()
Checks if optional
bool
isDefaultValueAvailable()
Checks if a default value is available
mixed
getDefaultValue()
Gets default parameter value
bool
isDefaultValueConstant()
Returns whether the default value of this parameter is constant
string|null
getDefaultValueConstantName()
Returns the default value's constant name if default value is constant or null
bool
isVariadic()
Returns whether this function is variadic
bool
isPromoted()
Returns information about whether the parameter is a promoted.
array
getAttributes(string|null $name = null, int $flags = 0)
No description