<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.funchand.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.get-defined-functions.php',
    1 => 'get_defined_functions',
    2 => '返回所有已定义函数的数组',
  ),
  'up' => 
  array (
    0 => 'ref.funchand.php',
    1 => '函数处理 函数',
  ),
  'prev' => 
  array (
    0 => 'function.function-exists.php',
    1 => 'function_exists',
  ),
  'next' => 
  array (
    0 => 'function.register-shutdown-function.php',
    1 => 'register_shutdown_function',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/funchand/functions/get-defined-functions.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.get-defined-functions" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">get_defined_functions</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">get_defined_functions</span> &mdash; <span class="dc-title">返回所有已定义函数的数组</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.get-defined-functions-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>get_defined_functions</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$exclude_disabled</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></span></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-defined-functions-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">exclude_disabled</code></dt>
    <dd>
     <p class="para">
      禁用的函数是否应该在返回值中排除。自 PHP 8.0.0 起，此参数不再起作用。
     </p>
     <div class="warning"><strong class="warning">警告</strong><p class="simpara">此功能自 PHP 8.5.0
起<em>弃用</em>。强烈建议不要应用此功能。</p></div>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.get-defined-functions-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回数组，包含了所有已定义的函数，包括内置/用户定义的函数。可通过 <var class="varname">$arr["internal"]</var>
   来访问系统内置函数，通过 <var class="varname">$arr["user"]</var> 来访问用户自定义函数（参见示例）。
  </p>
 </div>


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

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.5.0</td>
      <td>
       已弃用 <code class="parameter">exclude_disabled</code> 参数，因为它不再具有任何作用。
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">exclude_disabled</code> 参数的默认值从 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> 更改为
       <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>。然而，由于禁用的函数在编译时已从函数表中移除，因此该参数不会产生任何作用。
      </td>
     </tr>

     <tr>
      <td>7.0.15, 7.1.1</td>
      <td>
       新增 <code class="parameter">exclude_disabled</code> 参数。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.get-defined-functions-examples">
  <h3 class="title">示例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>示例 #1 <span class="function"><strong>get_defined_functions()</strong></span> 例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">myrow</span><span style="color: #007700">(</span><span style="color: #0000BB">$id</span><span style="color: #007700">, </span><span style="color: #0000BB">$data</span><span style="color: #007700">)<br />{<br />    return </span><span style="color: #DD0000">"&lt;tr&gt;&lt;th&gt;</span><span style="color: #0000BB">$id</span><span style="color: #DD0000">&lt;/th&gt;&lt;td&gt;</span><span style="color: #0000BB">$data</span><span style="color: #DD0000">&lt;/td&gt;&lt;/tr&gt;\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$arr </span><span style="color: #007700">= </span><span style="color: #0000BB">get_defined_functions</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$arr</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
(
    [internal] =&gt; Array
        (
            [0] =&gt; zend_version
            [1] =&gt; func_num_args
            [2] =&gt; func_get_arg
            [3] =&gt; func_get_args
            [4] =&gt; strlen
            [5] =&gt; strcmp
            [6] =&gt; strncmp
            ...
            [750] =&gt; bcscale
            [751] =&gt; bccomp
        )

    [user] =&gt; Array
        (
            [0] =&gt; myrow
        )

)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.get-defined-functions-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.function-exists.php" class="function" rel="rdfs-seeAlso">function_exists()</a> - 如果给定的函数已经被定义就返回 true</span></li>
    <li><span class="function"><a href="function.get-defined-vars.php" class="function" rel="rdfs-seeAlso">get_defined_vars()</a> - 返回由所有已定义变量所组成的数组</span></li>
    <li><span class="function"><a href="function.get-defined-constants.php" class="function" rel="rdfs-seeAlso">get_defined_constants()</a> - 返回所有常量的关联数组，键是常量名，值是常量值</span></li>
    <li><span class="function"><a href="function.get-declared-classes.php" class="function" rel="rdfs-seeAlso">get_declared_classes()</a> - 返回由已定义类的名字所组成的数组</span></li>
   </ul>
  </p>
 </div>


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