<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.reflectionclass.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'reflectionclass.getdoccomment.php',
    1 => 'ReflectionClass::getDocComment',
    2 => '获取文档注释',
  ),
  'up' => 
  array (
    0 => 'class.reflectionclass.php',
    1 => 'ReflectionClass',
  ),
  'prev' => 
  array (
    0 => 'reflectionclass.getdefaultproperties.php',
    1 => 'ReflectionClass::getDefaultProperties',
  ),
  'next' => 
  array (
    0 => 'reflectionclass.getendline.php',
    1 => 'ReflectionClass::getEndLine',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/reflection/reflectionclass/getdoccomment.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reflectionclass.getdoccomment" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionClass::getDocComment</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ReflectionClass::getDocComment</span> &mdash; <span class="dc-title">获取文档注释</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-reflectionclass.getdoccomment-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ReflectionClass::getDocComment</strong></span>(): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   从类中获取文档注释。文档注释以 <code class="literal">/**</code> 开头，后跟空格。
   如果类定义上方有多个文档注释，则采用最接近该类的注释。
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-reflectionclass.getdoccomment-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectionclass.getdoccomment-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   如果存在则返回文档注释，否则返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-reflectionclass.getdoccomment-examples">
  <h3 class="title">示例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>示例 #1 <span class="methodname"><strong>ReflectionClass::getDocComment()</strong></span> 示例</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/**<br /> * A test class<br /> *<br /> * @param  foo bar<br /> * @return baz<br /> */<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">TestClass </span><span style="color: #007700">{ }<br /><br /></span><span style="color: #0000BB">$rc </span><span style="color: #007700">= new </span><span style="color: #0000BB">ReflectionClass</span><span style="color: #007700">(</span><span style="color: #DD0000">'TestClass'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$rc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getDocComment</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>以上示例会输出：</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">string(61) &quot;/** 
 * A test class
 *
 * @param  foo bar
 * @return baz
 */&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-reflectionclass.getdoccomment-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="reflectionclass.getname.php" class="methodname" rel="rdfs-seeAlso">ReflectionClass::getName()</a> - 获取类名</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>