<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/reserved.variables.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'reserved.variables.phperrormsg.php',
    1 => '$php_errormsg',
    2 => 'The previous error message',
  ),
  'up' => 
  array (
    0 => 'reserved.variables.php',
    1 => 'Predefined Variables',
  ),
  'prev' => 
  array (
    0 => 'reserved.variables.cookies.php',
    1 => '$_COOKIE',
  ),
  'next' => 
  array (
    0 => 'reserved.variables.httpresponseheader.php',
    1 => '$http_response_header',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/predefined/variables/phperrormsg.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reserved.variables.phperrormsg" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">$php_errormsg</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">$php_errormsg</span> &mdash; <span class="dc-title">The previous error message</span></p>

 </div>

 <div id="reserved.variables.phperrormsg-refsynopsisdiv">
  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">This feature has been
<em>DEPRECATED</em> as of PHP 7.2.0, and <em>REMOVED</em> as of PHP 8.0.0. Relying on this feature
is highly discouraged.</p></div>
  <p class="simpara">
   Use <span class="function"><a href="function.error-get-last.php" class="function">error_get_last()</a></span> instead.
  </p>
 </div>
 
 <div class="refsect1 description" id="refsect1-reserved.variables.phperrormsg-description">
  <h3 class="title">Description</h3>
  <p class="para">
   <var class="varname">$php_errormsg</var> is a variable containing the
   text of the last error message generated by PHP. This variable
   will only be available within the scope in which the error
   occurred, and only if the <a href="errorfunc.configuration.php#ini.track-errors" class="link">track_errors</a> configuration
   option is turned on (it defaults to off).
  </p>
  <div class="warning"><strong class="warning">Warning</strong>
   <p class="simpara">
    If a user defined error handler (<span class="function"><a href="function.set-error-handler.php" class="function">set_error_handler()</a></span>)
    is set <var class="varname">$php_errormsg</var> is only set if the error handler
    returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
   </p>
  </div>
 </div>


 <div class="refsect1 changelog" id="refsect1-reserved.variables.phperrormsg-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        Directive <a href="errorfunc.configuration.php#ini.track-errors" class="link">track_errors</a> which
        caused <var class="varname">$php_errormsg</var> to be available has been
        removed.
       </td>
      </tr>

      <tr>
       <td>7.2.0</td>
       <td>
        Directive <a href="errorfunc.configuration.php#ini.track-errors" class="link">track_errors</a> which
        caused <var class="varname">$php_errormsg</var> to be available has been
        deprecated.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-reserved.variables.phperrormsg-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="variable.phperrormsg.basic">
    <p><strong>Example #1 <var class="varname">$php_errormsg</var> example</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">@</span><span style="color: #0000BB">strpos</span><span style="color: #007700">();<br />echo </span><span style="color: #0000BB">$php_errormsg</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>The above example will output
something similar to:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Wrong parameter count for strpos()</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-reserved.variables.phperrormsg-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.error-get-last.php" class="function" rel="rdfs-seeAlso">error_get_last()</a> - Get the last occurred error</span></li>
   </ul>
  </p>
 </div>


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