<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.libxml.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.libxml-use-internal-errors.php',
    1 => 'libxml_use_internal_errors',
    2 => 'D&eacute;sactive le rapport d\'erreur libxml et les stocke pour lecture ult&eacute;rieure',
  ),
  'up' => 
  array (
    0 => 'ref.libxml.php',
    1 => 'Fonctions libxml',
  ),
  'prev' => 
  array (
    0 => 'function.libxml-set-streams-context.php',
    1 => 'libxml_set_streams_context',
  ),
  'next' => 
  array (
    0 => 'book.simplexml.php',
    1 => 'SimpleXML',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/libxml/functions/libxml-use-internal-errors.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.libxml-use-internal-errors" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">libxml_use_internal_errors</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">libxml_use_internal_errors</span> &mdash; <span class="dc-title">
   Désactive le rapport d&#039;erreur libxml et les stocke pour lecture ultérieure
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.libxml-use-internal-errors-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>libxml_use_internal_errors</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span> <code class="parameter">$use_errors</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>libxml_use_internal_errors()</strong></span> permet de désactiver
   le gestionnaire d&#039;erreurs libxml standard, et d&#039;activer le propre
   gestionnaire d&#039;erreur.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.libxml-use-internal-errors-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">use_errors</code></dt>
      <dd>
       <p class="para">
        Active (<strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>) le gestionnaire d&#039;erreurs utilisateur
        ou le désactive (<strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>). La désactivation effacera aussi
        toutes les erreurs libxml existantes.
       </p>
      </dd>
     
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.libxml-use-internal-errors-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   <span class="function"><strong>libxml_use_internal_errors()</strong></span> retourne la valeur
   précédemment configurée pour <code class="parameter">use_errors</code>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.libxml-use-internal-errors-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">use_errors</code> est désormais nullable. Auparavant,
       sa valeur par défaut était <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.libxml-use-internal-errors-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>libxml_use_internal_errors()</strong></span></strong></p>
    <div class="example-contents"><p>
     Cet exemple montre l&#039;utilisation de base des erreurs libxml, et la valeur 
     retournée par cette fonction.
    </p></div>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// active la gestion d'erreur personnalisée<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">libxml_use_internal_errors</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">));<br /><br /></span><span style="color: #FF8000">// Chargement du document<br /></span><span style="color: #0000BB">$doc </span><span style="color: #007700">= new </span><span style="color: #0000BB">DOMDocument</span><span style="color: #007700">;<br /><br />if (!</span><span style="color: #0000BB">$doc</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">(</span><span style="color: #DD0000">'file.xml'</span><span style="color: #007700">)) {<br />    foreach (</span><span style="color: #0000BB">libxml_get_errors</span><span style="color: #007700">() as </span><span style="color: #0000BB">$error</span><span style="color: #007700">) {<br />        </span><span style="color: #FF8000">// gérer les erreurs ici<br />    </span><span style="color: #007700">}<br /><br />    </span><span style="color: #0000BB">libxml_clear_errors</span><span style="color: #007700">();<br />}<br /><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="annotation-interactive examplescode"><pre class="examplescode">bool(false)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.libxml-use-internal-errors-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.libxml-clear-errors.php" class="function" rel="rdfs-seeAlso">libxml_clear_errors()</a> - Vide le buffer d'erreur libxml</span></li>
    <li><span class="function"><a href="function.libxml-get-errors.php" class="function" rel="rdfs-seeAlso">libxml_get_errors()</a> - Lit le tableau d'erreurs</span></li>
   </ul>
  </p>
 </div>

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