<?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 => 'es',
  ),
  'this' => 
  array (
    0 => 'function.libxml-use-internal-errors.php',
    1 => 'libxml_use_internal_errors',
    2 => 'Se desactiva el reporte de errores de libxml y se almacenan para su lectura posterior',
  ),
  'up' => 
  array (
    0 => 'ref.libxml.php',
    1 => 'Funciones de 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' => 'es',
    '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">
   Se desactiva el reporte de errores de libxml y se almacenan para su lectura posterior
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.libxml-use-internal-errors-description">
  <h3 class="title">Descripción</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> permite desactivar
   el gestor de errores estándar de libxml y activar el propio
   gestor de errores.
  </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">
        Activa (<strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>) el gestor de errores del usuario
        o lo desactiva (<strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>). La desactivación borrará también
        todos los errores de libxml existentes.
       </p>
      </dd>
     
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.libxml-use-internal-errors-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
   <span class="function"><strong>libxml_use_internal_errors()</strong></span> devuelve el valor
   previamente configurado para <code class="parameter">use_errors</code>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.libxml-use-internal-errors-changelog">
  <h3 class="title">Historial de cambios</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versión</th>
      <th>Descripción</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">use_errors</code> ahora es nullable. Anteriormente,
       su valor por omisión 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">Ejemplos</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Ejemplo #1 Ejemplo con <span class="function"><strong>libxml_use_internal_errors()</strong></span></strong></p>
    <div class="example-contents"><p>
     Este ejemplo muestra el uso básico de los errores de libxml, y el valor
     devuelto por esta función.
    </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">// activa la gestión de errores personalizada<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">// Carga del 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">'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">// gestionar los errores aquí<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>El ejemplo anterior mostrará:</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">Ver también</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> - Vac&iacute;a el b&uacute;fer de errores de libxml</span></li>
    <li><span class="function"><a href="function.libxml-get-errors.php" class="function" rel="rdfs-seeAlso">libxml_get_errors()</a> - Lee el array de errores</span></li>
   </ul>
  </p>
 </div>

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