cvs: phpdoc-es /reference/errorfunc/functions error-reporting.xml
| From: | Javier Eguiluz | Date: | Thu, 20 Jan 2005 12:19:09 +0000 |
| Subject: | cvs: phpdoc-es /reference/errorfunc/functions error-reporting.xml | ||
| Groups: | php.doc.es | ||
| Request: | Send a blank email to doc-es+get-733@lists.php.net to get a copy of this message | ||
javi Thu Jan 20 07:19:09 2005 EDT
Modified files:
/phpdoc-es/reference/errorfunc/functions error-reporting.xml
Log:
Actualizada a la version en ingles (muchos cambios)
http://cvs.php.net/diff.php/phpdoc-es/reference/errorfunc/functions/error-reporting.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc-es/reference/errorfunc/functions/error-reporting.xml
diff -u phpdoc-es/reference/errorfunc/functions/error-reporting.xml:1.1
phpdoc-es/reference/errorfunc/functions/error-reporting.xml:1.2
--- phpdoc-es/reference/errorfunc/functions/error-reporting.xml:1.1 Sun Apr 14 20:13:39 2002
+++ phpdoc-es/reference/errorfunc/functions/error-reporting.xml Thu Jan 20 07:19:08 2005
@@ -4,7 +4,7 @@
<refentry id="function.error-reporting">
<refnamediv>
<refname>error_reporting</refname>
- <refpurpose>establece que errores PHP son registrados</refpurpose>
+ <refpurpose>Establece que errores de PHP son informados</refpurpose>
</refnamediv>
<refsect1>
<title>Descripción</title>
@@ -13,47 +13,147 @@
<methodparam
choice="opt"><type>int</type><parameter>level</parameter></methodparam>
</methodsynopsis>
<para>
- Establece el nivel de registro de los errores PHP y devuelve el nivel
- anterior. El nivel de registro es una máscara de bits de los valores
- siguientes (siga los enlaces a los valores internos para obtener sus
- significados):
+ La función <function>error_reporting</function> permite establecer la
directiva
+ <link linkend="ini.error-reporting">error_reporting</link> en tiempo de
ejecución. PHP tiene numerosos niveles de errores, que se pueden seleccionar de manera
temporal (mientras dure la ejecución del script) mediante esta función.
+ </para>
+ <para>
+ <function>error_reporting</function> establece el nivel de errores que notifica
PHP y devuelve el nivel anterior. El parámetro <parameter>level</parameter>
se puede establecer mediante una máscara de bits o mediante algunas constantes
específicas. Se recomienda utilizar las constantes para asegurar la compatibilidad con
versiones futuras. La causa de esta posible incompatibilidad es que a medida que se crean nuevos
niveles de errores, aumenta el rango de números utilizado para indicarlo, por lo que
podrían dejar de funcionar los anteriores niveles de errores indicados
numéricamente.
+ </para>
+ <para>
+ <example role="php">
+ <title>Ejemplos de <function>error_reporting</function></title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+// Deshabilita la notificación de errores
+error_reporting(0);
+
+// Notifica errores simples de ejecución
+error_reporting(E_ERROR | E_WARNING | E_PARSE);
+
+// Utilizar E_NOTICE puede ser útil también (para notificar sobre
+// variables no inicializadas y otros errores de escritura ...)
+error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
+
+// Notifica todos los errores salvo E_NOTICE
+// Este nivel es el valor por defecto establecido en el archivo php.ini
+error_reporting(E_ALL ^ E_NOTICE);
+
+// Notifica todos los errores de PHP (en PHP 3 se puede utilizar la máscara 63)
+error_reporting(E_ALL);
+
+// Lo siguiente es equivalente a error_reporting(E_ALL);
+ini_set('error_reporting', E_ALL);
+
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ Los niveles de error disponibles se muestran a continuación. La
explicación de
+ cada uno de los niveles de error se encuentra en la sección <link
linkend="errorfunc.constants"></link>.
<table>
- <title><function>error_reporting</function> valores de bit</title>
+ <title>Constantes y máscaras de bits de los niveles de
<function>error_reporting</function></title>
<tgroup cols="2">
<thead>
- <row>
- <entry>valor</entry>
- <entry>nombre interno</entry>
- </row>
+ <row>
+ <entry>valor</entry>
+ <entry>constante</entry>
+ </row>
</thead>
<tbody>
- <row>
- <entry>1</entry>
- <entry><link linkend="internal.e-error">E_ERROR</link></entry>
- </row>
- <row>
- <entry>2</entry>
- <entry><link
linkend="internal.e-warning">E_WARNING</link></entry>
- </row>
- <row>
- <entry>4</entry>
- <entry><link linkend="internal.e-parse">E_PARSE</link></entry>
- </row>
- <row>
- <entry>8</entry>
- <entry><link
linkend="internal.e-notice">E_NOTICE</link></entry>
- </row>
- <row>
- <entry>16</entry>
- <entry><link
linkend="internal.e-core-error">E_CORE_ERROR</link></entry>
- </row>
- <row>
- <entry>32</entry>
- <entry><link
linkend="internal.e-core-warning">E_CORE_WARNING</link></entry>
- </row>
+ <row>
+ <entry>1</entry>
+ <entry>
+ <link linkend="e-error">E_ERROR</link>
+ </entry>
+ </row>
+ <row>
+ <entry>2</entry>
+ <entry>
+ <link linkend="e-warning">E_WARNING</link>
+ </entry>
+ </row>
+ <row>
+ <entry>4</entry>
+ <entry>
+ <link linkend="e-parse">E_PARSE</link>
+ </entry>
+ </row>
+ <row>
+ <entry>8</entry>
+ <entry>
+ <link linkend="e-notice">E_NOTICE</link>
+ </entry>
+ </row>
+ <row>
+ <entry>16</entry>
+ <entry>
+ <link linkend="e-core-error">E_CORE_ERROR</link>
+ </entry>
+ </row>
+ <row>
+ <entry>32</entry>
+ <entry>
+ <link linkend="e-core-warning">E_CORE_WARNING</link>
+ </entry>
+ </row>
+ <row>
+ <entry>64</entry>
+ <entry>
+ <link linkend="e-compile-error">E_COMPILE_ERROR</link>
+ </entry>
+ </row>
+ <row>
+ <entry>128</entry>
+ <entry>
+ <link linkend="e-compile-warning">E_COMPILE_WARNING</link>
+ </entry>
+ </row>
+ <row>
+ <entry>256</entry>
+ <entry>
+ <link linkend="e-user-error">E_USER_ERROR</link>
+ </entry>
+ </row>
+ <row>
+ <entry>512</entry>
+ <entry>
+ <link linkend="e-user-warning">E_USER_WARNING</link>
+ </entry>
+ </row>
+ <row>
+ <entry>1024</entry>
+ <entry>
+ <link linkend="e-user-error">E_USER_NOTICE</link>
+ </entry>
+ </row>
+ <row>
+ <entry>2047</entry>
+ <entry>
+ <link linkend="e-all">E_ALL</link>
+ </entry>
+ </row>
+ <row>
+ <entry>2048</entry>
+ <entry>
+ <link linkend="e-strict">E_STRICT</link>
+ </entry>
+ </row>
</tbody>
</tgroup>
- </table></para>
+ </table>
+ </para>
+ <warning>
+ <simpara>
+ Las versiones de PHP > 5.0.0 también incluyen el nivel
<constant>E_STRICT</constant> (valor 2048). <constant>E_ALL</constant>
<emphasis>NO</emphasis> incluye el nivel <constant>E_STRICT</constant>.
+ </simpara>
+ </warning>
+ <para>
+ Puede consultar también la directiva <link
linkend="ini.display-errors">display_errors</link> y la función
<function>ini_set</function>.
+ </para>
</refsect1>
</refentry>