<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.classobj.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.get-declared-classes.php',
    1 => 'get_declared_classes',
    2 => '返回由已定义类的名字所组成的数组',
  ),
  'up' => 
  array (
    0 => 'ref.classobj.php',
    1 => '类/对象 函数',
  ),
  'prev' => 
  array (
    0 => 'function.get-class-vars.php',
    1 => 'get_class_vars',
  ),
  'next' => 
  array (
    0 => 'function.get-declared-interfaces.php',
    1 => 'get_declared_interfaces',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/classobj/functions/get-declared-classes.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.get-declared-classes" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">get_declared_classes</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">get_declared_classes</span> &mdash; <span class="dc-title">返回由已定义类的名字所组成的数组</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.get-declared-classes-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>get_declared_classes</strong></span>(): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   返回由当前脚本中已定义类的名字组成的数组。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.get-declared-classes-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.get-declared-classes-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
    返回由当前脚本中已定义类的名字组成的数组。
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    需要注意的是额外类的出现依赖于你已编译到 PHP 
    中的库。这意味着你不能使用这些类名定义自己的类。在附录的
    <a href="reserved.classes.php" class="link">预定义类</a>
    部分有预定义类的列表。
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.get-declared-classes-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>7.4.0</td>
      <td>
       之前 <span class="function"><strong>get_declared_classes()</strong></span> 
       返回的顺序总是父类在前，子类在后。现在不会这样了。<span class="function"><strong>get_declared_classes()</strong></span>
       的返回值将不再保证顺序。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.get-declared-classes-examples">
  <h3 class="title">示例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>示例 #1 <span class="function"><strong>get_declared_classes()</strong></span> 示例</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">get_declared_classes</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="examplescode"><pre class="examplescode">Array
(
    [0] =&gt; stdClass
    [1] =&gt; __PHP_Incomplete_Class
    [2] =&gt; Directory
)</pre>
</div>
    </div>
   </div>
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.get-declared-classes-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.class-exists.php" class="function" rel="rdfs-seeAlso">class_exists()</a> - 查类是否已经定义</span></li>
    <li><span class="function"><a href="function.get-declared-interfaces.php" class="function" rel="rdfs-seeAlso">get_declared_interfaces()</a> - 返回一个数组包含所有已声明的接口</span></li>
    <li><span class="function"><a href="function.get-defined-functions.php" class="function" rel="rdfs-seeAlso">get_defined_functions()</a> - 返回所有已定义函数的数组</span></li>
   </ul>
  </p>
 </div>

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