<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.outcontrol.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'outcontrol.constants.php',
    1 => '预定义常量',
    2 => '预定义常量',
  ),
  'up' => 
  array (
    0 => 'book.outcontrol.php',
    1 => '输出控制',
  ),
  'prev' => 
  array (
    0 => 'outcontrol.configuration.php',
    1 => '运行时配置',
  ),
  'next' => 
  array (
    0 => 'outcontrol.output-buffering.php',
    1 => '输出缓冲',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/outcontrol/constants.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="outcontrol.constants" class="appendix">
 <h1 class="title">预定义常量</h1>

 <p class="simpara">
下列常量作为 PHP 核心的一部分总是可用的。
</p>
 <dl id="outcontrol.constants.flags-passed-to-handler">
  <strong class="title">传递给输出处理程序的状态 flag</strong>
  <p class="para">
   下列 flag 作为位掩码的一部分传递给由 <span class="function"><a href="function.ob-start.php" class="function">ob_start()</a></span> 设置的输出处理程序的第二个（<code class="parameter">phase</code>）参数：
  </p>
  
   <dt id="constant.php-output-handler-start">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-start">PHP_OUTPUT_HANDLER_START</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     表示输出缓冲已经开始。
    </p>
   </dd>
  
  
   <dt id="constant.php-output-handler-write">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-write">PHP_OUTPUT_HANDLER_WRITE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     表示输出缓冲区正在刷新，并且有数据要输出。
    </p>
   </dd>
  
  
   <dt id="constant.php-output-handler-flush">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-flush">PHP_OUTPUT_HANDLER_FLUSH</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     表示缓冲区已清空。
    </p>
   </dd>
  
  
   <dt id="constant.php-output-handler-clean">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-clean">PHP_OUTPUT_HANDLER_CLEAN</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     表示输出缓冲已清空。
    </p>
   </dd>
  
  
   <dt id="constant.php-output-handler-final">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-final">PHP_OUTPUT_HANDLER_FINAL</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     表示这是最后一次输出缓冲操作。
    </p>
   </dd>
  
  
   <dt id="constant.php-output-handler-cont">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-cont">PHP_OUTPUT_HANDLER_CONT</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     表示缓冲区已清空，但输出缓冲将继续。
    </p>
    <p class="para">
     这是 <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-write">PHP_OUTPUT_HANDLER_WRITE</a></code></strong> 的别名。
    </p>
   </dd>
  
  
   <dt id="constant.php-output-handler-end">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-end">PHP_OUTPUT_HANDLER_END</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     表示输出缓冲已结束。
    </p>
    <p class="para">
     这是 <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-final">PHP_OUTPUT_HANDLER_FINAL</a></code></strong> 的别名。
    </p>
   </dd>
  
 </dl>
 <dl id="outcontrol.constants.buffer-control-flags">
  <strong class="title">输出缓冲区控制 flag</strong>
  <p class="para">
   下列 flag 作为位掩码的一部分传递给由 <span class="function"><a href="function.ob-start.php" class="function">ob_start()</a></span> 设置的输出处理程序的第三个（<code class="parameter">flags</code>）参数：
  </p>
  
   <dt id="constant.php-output-handler-cleanable">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-cleanable">PHP_OUTPUT_HANDLER_CLEANABLE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     控制 <span class="function"><a href="function.ob-start.php" class="function">ob_start()</a></span> 创建的输出缓冲区是否可以由 <span class="function"><a href="function.ob-clean.php" class="function">ob_clean()</a></span> 清除。这个 flag
     不能控制 <span class="function"><a href="function.ob-end-clean.php" class="function">ob_end_clean()</a></span> 或 <span class="function"><a href="function.ob-get-clean.php" class="function">ob_get_clean()</a></span> 的行为。
    </p>
   </dd>
  
  
   <dt id="constant.php-output-handler-flushable">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-flushable">PHP_OUTPUT_HANDLER_FLUSHABLE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     控制 <span class="function"><a href="function.ob-start.php" class="function">ob_start()</a></span> 创建的输出缓冲区是否可以由 <span class="function"><a href="function.ob-flush.php" class="function">ob_flush()</a></span> 刷新。这个 flag
     不能控制 <span class="function"><a href="function.ob-end-flush.php" class="function">ob_end_flush()</a></span> 或 <span class="function"><a href="function.ob-get-flush.php" class="function">ob_get_flush()</a></span> 的行为。
    </p>
   </dd>
  
  
   <dt id="constant.php-output-handler-removable">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-removable">PHP_OUTPUT_HANDLER_REMOVABLE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     控制 <span class="function"><a href="function.ob-start.php" class="function">ob_start()</a></span> 创建的输出缓冲区是否可以在脚本结束前或者调用
     <span class="function"><a href="function.ob-end-clean.php" class="function">ob_end_clean()</a></span>、<span class="function"><a href="function.ob-end-flush.php" class="function">ob_end_flush()</a></span>、<span class="function"><a href="function.ob-get-clean.php" class="function">ob_get_clean()</a></span> 或 <span class="function"><a href="function.ob-get-flush.php" class="function">ob_get_flush()</a></span> 移除。
    </p>
   </dd>
  
  
   <dt id="constant.php-output-handler-stdflags">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-stdflags">PHP_OUTPUT_HANDLER_STDFLAGS</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     输出缓冲区 flag 的默认设置；当前等同于
     <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-cleanable">PHP_OUTPUT_HANDLER_CLEANABLE</a></code></strong> |
     <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-flushable">PHP_OUTPUT_HANDLER_FLUSHABLE</a></code></strong> |
     <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-removable">PHP_OUTPUT_HANDLER_REMOVABLE</a></code></strong>.
    </p>
   </dd>
  
 </dl>
 <dl id="outcontrol.constants.flags-returned-by-handler">
  <strong class="title">输出处理程序状态 flag</strong>
  <p class="para">
   下列 flag 是由 <span class="function"><a href="function.ob-get-status.php" class="function">ob_get_status()</a></span> 返回的 <code class="literal">flags</code> 位掩码的一部分：
  </p>
  
   <dt id="constant.php-output-handler-started">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-started">PHP_OUTPUT_HANDLER_STARTED</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     表示输出处理程序已调用。
    </p>
   </dd>
  
  
   <dt id="constant.php-output-handler-disabled">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-disabled">PHP_OUTPUT_HANDLER_DISABLED</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     表示输出处理程序已禁用。当输出处理程序返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> 
     或者处理缓冲区失败时设置此 flag。
     在 PHP 8.4.0 之前，此 flag 可以在启动输出缓冲区时设置。
    </p>
   </dd>
  
  
   <dt id="constant.php-output-handler-processed">
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-processed">PHP_OUTPUT_HANDLER_PROCESSED</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <p class="para">
     表示输出处理程序已经成功处理了缓冲区。
     自 PHP 8.4.0 起可用。
    </p>
   </dd>
  
 </dl>
</div>
<?php manual_footer($setup); ?>