array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'class.reflectionparameter.php', 1 => 'ReflectionParameter', ), 'up' => array ( 0 => 'book.reflection.php', 1 => '反射', ), 'prev' => array ( 0 => 'reflectionobject.export.php', 1 => 'ReflectionObject::export', ), 'next' => array ( 0 => 'reflectionparameter.allowsnull.php', 1 => 'ReflectionParameter::allowsNull', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/reflection/reflectionparameter.xml', ), 'extra_header_links' => array ( 'rel' => 'alternate', 'href' => '/manual/en/feeds/class.reflectionparameter.atom', 'type' => 'application/atom+xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5, PHP 7, PHP 8)
ReflectionParameter 检索函数或方法参数的相关信息。
要自行检查函数的参数,首先创建 ReflectionFunction 或 ReflectionMethod 的实例,然后使用它们的 ReflectionFunctionAbstract::getParameters() 方法来检索参数的数组。
参数名。只读,在尝试赋值的时候会抛出 ReflectionException。
版本 | 说明 |
---|---|
8.0.0 | 已移除 ReflectionParameter::export()。 |