ReflectionParameter::__constructConstructeur
&reftitle.description;
publicReflectionParameter::__constructstringarrayobjectfunctionintstringparam
Construit une instance ReflectionParameter.
&reftitle.parameters;
function
La fonction depuis laquelle les paramètres sont reflétés.
param
Soit un &integer; spécifiant la position du paramètre (commençant par
zéro), soit le nom du paramètre en tant que &string;.
&reftitle.examples;
Exemple avec ReflectionParameter
getParameters() as $i => $param) {
printf(
"-- Parameter #%d: %s {\n".
" Class: %s\n".
" Allows NULL: %s\n".
" Passed to by reference: %s\n".
" Is optional?: %s\n".
"}\n",
$i, // $param->getPosition() can be used
$param->getName(),
var_export($param->getClass(), 1),
var_export($param->allowsNull(), 1),
var_export($param->isPassedByReference(), 1),
$param->isOptional() ? 'yes' : 'no'
);
}
?>
]]>
&example.outputs.similar;
function foo ] {
@@ /Users/philip/cvs/phpdoc/a 2 - 2
- Parameters [3] {
Parameter #0 [ $a ]
Parameter #1 [ $b ]
Parameter #2 [ $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
}
]]>
&reftitle.seealso;
ReflectionFunctionAbstract::getParametersReflectionFunction::__constructReflectionMethod::__constructLes constructeurs