ReflectionParameter::__construct
En esta página
ReflectionParameter::__construct
Constructor
Descripción#
public ReflectionParameter::__construct(string $function, int $param)
```php
Construye una instancia `ReflectionParameter`.
## Parámetros
`function`
La función desde la cual los parámetros son reflejados.
`param`
Puede ser un `int` que especifica la posición del parámetro (comenzando por cero), o el nombre del parámetro como `string`.
## Ejemplos
Ejemplo con `ReflectionParameter`
```php
Resultado del ejemplo anterior es similar a:
Function [ <user> function foo ] {
@@ /Users/philip/cvs/phpdoc/a 2 - 2
- Parameters [3] {
Parameter #0 [ <required> $a ]
Parameter #1 [ <required> $b ]
Parameter #2 [ <required> $c ]
}
}
-- Parameter #0: a {
Class: NULL
Allows NULL: true
Passed to by reference: false
Is optional?: no
}
-- Parameter #1: b {
Class: NULL
Allows NULL: true
Passed to by reference: false
Is optional?: no
}
-- Parameter #2: c {
Class: NULL
Allows NULL: true
Passed to by reference: false
Is optional?: no
}
Véase también#
ReflectionFunctionAbstract::getParameters, ReflectionFunction::__construct, ReflectionMethod::__construct, Los constructores