<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.errorfunc.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.restore-error-handler.php',
    1 => 'restore_error_handler',
    2 => 'R&eacute;active l\'ancienne fonction de gestion des erreurs',
  ),
  'up' => 
  array (
    0 => 'ref.errorfunc.php',
    1 => 'Fonctions sur la gestion des erreurs',
  ),
  'prev' => 
  array (
    0 => 'function.get-exception-handler.php',
    1 => 'get_exception_handler',
  ),
  'next' => 
  array (
    0 => 'function.restore-exception-handler.php',
    1 => 'restore_exception_handler',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/errorfunc/functions/restore-error-handler.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.restore-error-handler" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">restore_error_handler</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.1, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">restore_error_handler</span> &mdash; <span class="dc-title">Réactive l&#039;ancienne fonction de gestion des erreurs</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.restore-error-handler-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>restore_error_handler</strong></span>(): <span class="type"><a href="language.types.singleton.php" class="type true">true</a></span></div>

  <p class="para rdfs-comment">
   Utilisée après avoir modifié la fonction de gestion
   des erreurs, grâce à <span class="function"><a href="function.set-error-handler.php" class="function">set_error_handler()</a></span>,
   <span class="function"><strong>restore_error_handler()</strong></span> permet de réutiliser
   l&#039;ancienne version de gestion des erreurs (qui peut être la
   fonction PHP par défaut, ou une autre fonction utilisateur).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.restore-error-handler-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">Cette fonction ne contient aucun paramètre.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.restore-error-handler-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne toujours <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.restore-error-handler-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>restore_error_handler()</strong></span></strong></p>
    <div class="example-contents"><p>
     Si <span class="function"><a href="function.unserialize.php" class="function">unserialize()</a></span> cause une erreur, alors le gestionnaire
     d&#039;erreurs original est restauré.
    </p></div>
    <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">unserialize_handler</span><span style="color: #007700">(</span><span style="color: #0000BB">$errno</span><span style="color: #007700">, </span><span style="color: #0000BB">$errstr</span><span style="color: #007700">)<br />{<br />echo </span><span style="color: #DD0000">"Valeur incorrectement sérialisée.\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$serialized </span><span style="color: #007700">= </span><span style="color: #DD0000">'foo'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">set_error_handler</span><span style="color: #007700">(</span><span style="color: #DD0000">'unserialize_handler'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$original </span><span style="color: #007700">= </span><span style="color: #0000BB">unserialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$serialized</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">restore_error_handler</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>L&#039;exemple ci-dessus va afficher :</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Valeur incorrectement sérialisée.</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.restore-error-handler-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.error-reporting.php" class="function" rel="rdfs-seeAlso">error_reporting()</a> - Fixe le niveau de rapport d'erreurs PHP</span></li>
    <li><span class="function"><a href="function.set-error-handler.php" class="function" rel="rdfs-seeAlso">set_error_handler()</a> - Sp&eacute;cifie une fonction utilisateur comme gestionnaire d'erreurs</span></li>
    <li><span class="function"><a href="function.get-error-handler.php" class="function" rel="rdfs-seeAlso">get_error_handler()</a> - Renvoie la fonction de gestion d'erreur d&eacute;finie par l'utilisateur</span></li>
    <li><span class="function"><a href="function.restore-exception-handler.php" class="function" rel="rdfs-seeAlso">restore_exception_handler()</a> - R&eacute;active l'ancienne fonction de gestion d'exceptions</span></li>
    <li><span class="function"><a href="function.trigger-error.php" class="function" rel="rdfs-seeAlso">trigger_error()</a> - D&eacute;clenche une erreur utilisateur</span></li>
   </ul>
  </p>
 </div>

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