<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/outcontrol.user-level-output-buffers.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'outcontrol.flags-passed-to-output-handlers.php',
    1 => 'Flags Passed To Output Handlers',
    2 => 'Flags Passed To Output Handlers',
  ),
  'up' => 
  array (
    0 => 'outcontrol.user-level-output-buffers.php',
    1 => 'User-Level Output Buffers',
  ),
  'prev' => 
  array (
    0 => 'outcontrol.working-with-output-handlers.php',
    1 => 'Working With Output Handlers',
  ),
  'next' => 
  array (
    0 => 'outcontrol.output-handler-return-values.php',
    1 => 'Output Handler Return Values',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/outcontrol/user-level-output-buffers.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="outcontrol.flags-passed-to-output-handlers" class="section">
  <h2 class="title">Flags Passed To Output Handlers</h2>
  <p class="para">
   The bitmask passed to the second <code class="parameter">phase</code> parameter
   of the output handler provides information on the invocation of the handler.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    The bitmask can include more than one flag
    and the bitwise <code class="literal">&amp;</code> operator should be used
    to check whether a flag is set.
   </span>
  </p></blockquote>
  <div class="warning"><strong class="warning">Warning</strong>
   <p class="simpara">
    The value of <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-write">PHP_OUTPUT_HANDLER_WRITE</a></code></strong> and its alias
    <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-cont">PHP_OUTPUT_HANDLER_CONT</a></code></strong> is <code class="literal">0</code>
    therefore whether it is set can only be determined
    by using an
    <a href="language.operators.comparison.php" class="link">equality operator</a>
    (<code class="literal">==</code> or <code class="literal">===</code>).
   </p>
  </div>
  <p class="para">
   The following flags are set in a specific phase of the handler&#039;s lifecycle:
   <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-start">PHP_OUTPUT_HANDLER_START</a></code></strong> is set
   when a handler is invoked for the first time.
   <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-final">PHP_OUTPUT_HANDLER_FINAL</a></code></strong>
   or its alias <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-end">PHP_OUTPUT_HANDLER_END</a></code></strong>
   is set when a handler is invoked for the last time,
   i.e. it is being turned off. This flag is also set
   when buffers are being turned off by PHP&#039;s shutdown process.
  </p>
  <p class="para">
   The following flags are set by a specific invocation of the handler:
   <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-flush">PHP_OUTPUT_HANDLER_FLUSH</a></code></strong> is set
   when the handler is invoked by calling <span class="function"><a href="function.ob-flush.php" class="function">ob_flush()</a></span>.
   <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-write">PHP_OUTPUT_HANDLER_WRITE</a></code></strong>
   or its alias <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-cont">PHP_OUTPUT_HANDLER_CONT</a></code></strong>
   is set when the size of its contents equals or exceeds the size of the buffer
   and the handler is invoked while the buffer is being automatically flushed.
   <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-flush">PHP_OUTPUT_HANDLER_FLUSH</a></code></strong> is set
   when the handler is invoked by calling <span class="function"><a href="function.ob-clean.php" class="function">ob_clean()</a></span>,
   <span class="function"><a href="function.ob-end-clean.php" class="function">ob_end_clean()</a></span> or <span class="function"><a href="function.ob-get-clean.php" class="function">ob_get_clean()</a></span>.
   When <span class="function"><a href="function.ob-end-clean.php" class="function">ob_end_clean()</a></span> or <span class="function"><a href="function.ob-get-clean.php" class="function">ob_get_clean()</a></span>
   is called, <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-final">PHP_OUTPUT_HANDLER_FINAL</a></code></strong> is set as well.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    When <span class="function"><a href="function.ob-end-flush.php" class="function">ob_end_flush()</a></span> or <span class="function"><a href="function.ob-get-flush.php" class="function">ob_get_flush()</a></span>
    is called, <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-final">PHP_OUTPUT_HANDLER_FINAL</a></code></strong> is set
    but <strong><code><a href="outcontrol.constants.php#constant.php-output-handler-flush">PHP_OUTPUT_HANDLER_FLUSH</a></code></strong> is not.
   </span>
  </p></blockquote>
 </div><?php manual_footer($setup); ?>