Callable Types
Callable types describe an arbitrary type that describes a function.
Each callable MAY have a list of parameters and/or a return type definition.
Named Parameters
The name after the type of the parameter defines the parameter that allows passing by name.
The name must appear after the parameter type and begin with a " $ " sign. Just like in the PHP language.
Output Parameters
Passing a parameter by reference means that the function can change the passed variable while it is running.
To indicate that a parameter is passed by reference, an " & " sign is used after the type and before the name.
Optional Parameters
An optional parameter means that the argument may not be passed when such a function is called.
An optional parameter is indicated by the " = " sign at the end of the parameter description.
Variadic Parameters
Variadic parameters are indicated by the " ... " and can be placed either before the type or before the parameter name.
Attributes
Each callable parameter allows you to define list of additional attributes. An attribute is additional metadata for a parameter.
03 February 2025