<?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 => 'pt_BR',
  ),
  'this' => 
  array (
    0 => 'function.libxml-use-internal-errors.php',
    1 => 'libxml_use_internal_errors',
    2 => 'Desabilita erros da libxml e permite que o usu&aacute;rio obtenha informa&ccedil;&otilde;es de erro conforme necess&aacute;rio',
  ),
  'up' => 
  array (
    0 => 'ref.libxml.php',
    1 => 'Fun&ccedil;&otilde;es da 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' => 'pt_BR',
    '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">
   Desabilita erros da libxml e permite que o usuário obtenha informações de erro conforme necessário
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.libxml-use-internal-errors-description">
  <h3 class="title">Descrição</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">
   A função <span class="function"><strong>libxml_use_internal_errors()</strong></span> permite desabilitar
   os erros padrão da libxml e habilitar o tratamento de erros do usuário.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.libxml-use-internal-errors-parameters">
  <h3 class="title">Parâmetros</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">use_errors</code></dt>
      <dd>
       <p class="para">
        Habilita (<strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>) ou desabilita (<strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>) o tratamento de erros do usuário. Desabilitar também limpará quaisquer erros libxml existentes.
       </p>
      </dd>
     
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.libxml-use-internal-errors-returnvalues">
  <h3 class="title">Valor Retornado</h3>
  <p class="para">
   Esta função retorna o valor anterior de
   <code class="parameter">use_errors</code>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.libxml-use-internal-errors-changelog">
  <h3 class="title">Registro de Alterações</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versão</th>
      <th>Descrição</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       O parâmetro <code class="parameter">use_errors</code> agora pode ser nulo.
       Anteriormente, o padrão era <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">Exemplos</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemplo #1 Exemplo de <span class="function"><strong>libxml_use_internal_errors()</strong></span></strong></p>
    <div class="example-contents"><p>
     Este exemplo demonstra o uso básico dos erros da libxml e o valor retornado
     por esta função.
    </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">// habilita o tratamento de erros do usuário<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">// carrega o documento<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">'arquivo.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">$erro</span><span style="color: #007700">) {<br />        </span><span style="color: #FF8000">// trata os erros aqui<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>O exemplo acima produzirá:</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">Veja Também</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> - Limpa o buffer de erro da libxml</span></li>
    <li><span class="function"><a href="function.libxml-get-errors.php" class="function" rel="rdfs-seeAlso">libxml_get_errors()</a> - Obt&eacute;m um array de erros</span></li>
   </ul>
  </p>
 </div>

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