<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.errorfunc.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'errorfunc.constants.php',
    1 => 'Predefined Constants',
    2 => 'Predefined Constants',
  ),
  'up' => 
  array (
    0 => 'book.errorfunc.php',
    1 => 'Error Handling',
  ),
  'prev' => 
  array (
    0 => 'errorfunc.configuration.php',
    1 => 'Runtime Configuration',
  ),
  'next' => 
  array (
    0 => 'errorfunc.examples.php',
    1 => 'Examples',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/errorfunc/constants.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="errorfunc.constants" class="appendix">
 <h1 class="title">Predefined Constants</h1>

 <p class="simpara">
The constants below are always available as part of the PHP core.
</p>

 <p class="simpara">
  The following constants (either the corresponding numerical value or their
  symbolic name) are used as a bitmask to specify which errors to report.
  It is possible to use
  <a href="language.operators.bitwise.php" class="link">bitwise operators</a>
  to combine these values or mask out certain types of errors.
 </p>

 <div class="tip"><strong class="tip">Tip</strong>
  <p class="simpara">
   The name of the constants can be used within <var class="filename">php.ini</var>,
   instead of the raw numerical values to which they correspond to.
   However, only the
   <code class="literal">|</code>,
   <code class="literal">~</code>,
   <code class="literal">^</code>,
   <code class="literal">!</code>,
   <code class="literal">&amp;</code>
   operators are understood within <var class="filename">php.ini</var>.
  </p>
 </div>

 <div class="warning"><strong class="warning">Warning</strong>
  <p class="simpara">
   It is not possible to use the symbolic names outside of PHP.
   For example in <var class="filename">httpd.conf</var> the computed bitmask value must be used instead.
  </p>
 </div>

 <dl id="errorfunc.constants.errorlevels">
  
   <dt id="constant.e-error">
    <strong><code><a href="errorfunc.constants.php#constant.e-error">E_ERROR</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Fatal run-time errors.
     These indicate errors that can not be recovered from,
     such as a memory allocation problem.
     Execution of the script is halted.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">1</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-warning">
    <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Run-time warnings (non-fatal errors).
     Execution of the script is not halted.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">2</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-parse">
    <strong><code><a href="errorfunc.constants.php#constant.e-parse">E_PARSE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Compile-time parse errors.
     Parse errors should only be generated by the parser.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">4</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-notice">
    <strong><code><a href="errorfunc.constants.php#constant.e-notice">E_NOTICE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Run-time notices.
     Indicate that the script encountered something that could indicate an error,
     but could also happen in the normal course of running a script.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">8</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-core-error">
    <strong><code><a href="errorfunc.constants.php#constant.e-core-error">E_CORE_ERROR</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Fatal errors that occur during PHP&#039;s initial startup.
     This is like an <strong><code><a href="errorfunc.constants.php#constant.e-error">E_ERROR</a></code></strong>,
     except it is generated by the core of PHP.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">16</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-core-warning">
    <strong><code><a href="errorfunc.constants.php#constant.e-core-warning">E_CORE_WARNING</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Warnings (non-fatal errors) that occur during PHP&#039;s initial startup.
     This is like an <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>,
     except it is generated by the core of PHP.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">32</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-compile-error">
    <strong><code><a href="errorfunc.constants.php#constant.e-compile-error">E_COMPILE_ERROR</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Fatal compile-time errors.
     This is like an <strong><code><a href="errorfunc.constants.php#constant.e-error">E_ERROR</a></code></strong>,
     except it is generated by the Zend Scripting Engine.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">64</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-compile-warning">
    <strong><code><a href="errorfunc.constants.php#constant.e-compile-warning">E_COMPILE_WARNING</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Compile-time warnings (non-fatal errors).
     This is like an <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>,
     except it is generated by the Zend Scripting Engine.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">128</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-deprecated">
    <strong><code><a href="errorfunc.constants.php#constant.e-deprecated">E_DEPRECATED</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Run-time deprecation notices.
     Enable this to receive warnings about code
     that will not work in future versions.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">8192</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-user-error">
    <strong><code><a href="errorfunc.constants.php#constant.e-user-error">E_USER_ERROR</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     User-generated error message.
     This is like an <strong><code><a href="errorfunc.constants.php#constant.e-error">E_ERROR</a></code></strong>,
     except it is generated in PHP code by using the PHP function
     <span class="function"><a href="function.trigger-error.php" class="function">trigger_error()</a></span>.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">256</code>
    </span>
    <div class="warning"><strong class="warning">Warning</strong>
     <p class="simpara">
      Usage of this constant with <span class="function"><a href="function.trigger-error.php" class="function">trigger_error()</a></span> is
      deprecated as of PHP 8.4.0.
      It is recommended to either <a href="language.exceptions.php" class="link"><code class="literal">throw</code></a> an <span class="exceptionname"><a href="class.exception.php" class="exceptionname">Exception</a></span>
      or call <span class="function"><a href="function.exit.php" class="function">exit()</a></span> instead.
     </p>
    </div>
   </dd>
  

  
   <dt id="constant.e-user-warning">
    <strong><code><a href="errorfunc.constants.php#constant.e-user-warning">E_USER_WARNING</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     User-generated warning message.
     This is like an <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>,
     except it is generated in PHP code by using the PHP function
     <span class="function"><a href="function.trigger-error.php" class="function">trigger_error()</a></span>.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">512</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-user-notice">
    <strong><code><a href="errorfunc.constants.php#constant.e-user-notice">E_USER_NOTICE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     User-generated notice message.
     This is like an <strong><code><a href="errorfunc.constants.php#constant.e-notice">E_NOTICE</a></code></strong>,
     except it is generated in PHP code by using the PHP function
     <span class="function"><a href="function.trigger-error.php" class="function">trigger_error()</a></span>.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">1024</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-user-deprecated">
    <strong><code><a href="errorfunc.constants.php#constant.e-user-deprecated">E_USER_DEPRECATED</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     User-generated deprecation message.
     This is like an <strong><code><a href="errorfunc.constants.php#constant.e-deprecated">E_DEPRECATED</a></code></strong>,
     except it is generated in PHP code by using the PHP function
     <span class="function"><a href="function.trigger-error.php" class="function">trigger_error()</a></span>.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">16384</code>
    </span>
   </dd>
  

  
   <dt id="constant.e-strict">
    <strong><code><a href="errorfunc.constants.php#constant.e-strict">E_STRICT</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Run-time suggestions emitted by PHP about the executed code
     to ensure forward compatibility.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">2048</code>
    </span>
    <div class="warning"><strong class="warning">Warning</strong>
     <p class="simpara">
      This error level is unused,
      and has been deprecated as of PHP 8.4.0.
     </p>
    </div>
   </dd>
  

  
   <dt id="constant.e-recoverable-error">
    <strong><code><a href="errorfunc.constants.php#constant.e-recoverable-error">E_RECOVERABLE_ERROR</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Legacy engine &quot;exceptions&quot; which correspond to catchable fatal error.
     Similar to <span class="exceptionname"><a href="class.error.php" class="exceptionname">Error</a></span> but must be caught via a
     user defined error handler (see <span class="function"><a href="function.set-error-handler.php" class="function">set_error_handler()</a></span>).
     If not handled, this behaves like <strong><code><a href="errorfunc.constants.php#constant.e-error">E_ERROR</a></code></strong>.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">4096</code>
    </span>
    <blockquote class="note"><p><strong class="note">Note</strong>: 
     <span class="simpara">
      This error level is effectively unused,
      the only case where this can happen is when interpreting an
      <span class="type"><a href="language.types.object.php" class="type object">object</a></span> as a <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> fails.
      This can only happen for internal objects.
     </span>
     <span class="simpara">
      The most common example, prior to PHP 8.4.0, is using a
      <span class="classname"><a href="class.gmp.php" class="classname">GMP</a></span> instance in a conditional.
     </span>
    </p></blockquote>
   </dd>
  

  
   <dt id="constant.e-all">
    <strong><code><a href="errorfunc.constants.php#constant.e-all">E_ALL</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Bit-mask that contains every single error, warning, and notice.
    </span>
    <span class="simpara">
     Value of the constant: <code class="literal">30719</code>
    </span>
    <div class="warning"><strong class="warning">Warning</strong>
     <p class="simpara">
      Prior to PHP 8.4, the constant value was: <code class="literal">32767</code>
     </p>
    </div>
   </dd>
  

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