mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 00:12:06 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@349935 c90b9560-bf6c-de11-be94-00142212c4b1
183 lines
5.6 KiB
XML
183 lines
5.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: b824e2b1086e94a1077bd071964547283616030a Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no Maintainer: andresdzphp -->
|
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.error-reporting">
|
|
<refnamediv>
|
|
<refname>error_reporting</refname>
|
|
<refpurpose>Establece cuáles errores de PHP son notificados</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>error_reporting</methodname>
|
|
<methodparam choice="opt"><type>int</type><parameter>level</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
La función <function>error_reporting</function> establece la directiva
|
|
<link linkend="ini.error-reporting">error_reporting</link>
|
|
en tiempo de ejecución. PHP tiene varios niveles de errores para notificar, al utilizar
|
|
ésta función se define el nivel de duración (tiempo de ejecución) de
|
|
sus scripts. Si el parámetro opcional <parameter>level</parameter> no se define,
|
|
la función <function>error_reporting</function> sólo devolverá
|
|
el nivel actual de notificación de error.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>level</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El nuevo nivel de <link linkend="ini.error-reporting">error_reporting</link>.
|
|
Este nivel toma una máscara de bit o constantes nominadas. Al utilizar constantes
|
|
nominadas se recomienda encarecidamente asegurar la compatibilidad para versiones
|
|
futuras. Según se añaden niveles de error, el rango de los enteros incrementa,
|
|
por lo que los niveles antiguos de errores basados en enteros no siempre se comportarán
|
|
como se esperaba.
|
|
</para>
|
|
<para>
|
|
Las constantes de niveles de error disponibles, y los significados actuales
|
|
de esos niveles de error están descritos en
|
|
<link linkend="errorfunc.constants">constantes predefinidas</link>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve el nivel antiguo de <link linkend="ini.error-reporting">error_reporting</link>
|
|
o el nivel actual si el parámetro <parameter>level</parameter> no se proporciona.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.4.0</entry>
|
|
<entry>Ahora <constant>E_STRICT</constant> es parte de <constant>E_ALL</constant>.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>5.3.0</entry>
|
|
<entry>Se introdujo <constant>E_DEPRECATED</constant> y <constant>E_USER_DEPRECATED</constant>.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>5.2.0</entry>
|
|
<entry>Se introdujo <constant>E_RECOVERABLE_ERROR</constant>.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplos de <function>error_reporting</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// Desactivar toda notificación de error
|
|
error_reporting(0);
|
|
|
|
// Notificar solamente errores de ejecución
|
|
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
|
|
|
// Notificar E_NOTICE también puede ser bueno (para informar de variables
|
|
// no inicializadas o capturar errores en nombres de variables ...)
|
|
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
|
|
|
|
// Notificar todos los errores excepto E_NOTICE
|
|
error_reporting(E_ALL ^ E_NOTICE);
|
|
|
|
// Notificar todos los errores de PHP (ver el registro de cambios)
|
|
error_reporting(E_ALL);
|
|
|
|
// Notificar todos los errores de PHP
|
|
error_reporting(-1);
|
|
|
|
// Lo mismo que error_reporting(E_ALL);
|
|
ini_set('error_reporting', E_ALL);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<warning>
|
|
<simpara>
|
|
La mayoría de errores <constant>E_STRICT</constant> son evaluados en tiempo
|
|
de compilación por lo que tales errores no se notifican en el fichero donde
|
|
<link linkend="ini.error-reporting">error_reporting</link> se mejora
|
|
al incluir los errores de <constant>E_STRICT</constant> (y viceversa).
|
|
</simpara>
|
|
</warning>
|
|
<tip>
|
|
<simpara>
|
|
Al pasar el valor <literal>-1</literal> se mostrarán todos los errores posibles,
|
|
incluso cuando se añadan nuevos niveles y constantes en futuras versiones de PHP. La
|
|
constante <constant>E_ALL</constant> también se comporta de esta forma en PHP 5.4.
|
|
</simpara>
|
|
</tip>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member>La directiva <link linkend="ini.display-errors">display_errors</link></member>
|
|
<member>La directiva <link linkend="ini.html-errors">html_errors</link></member>
|
|
<member>La directiva <link linkend="ini.xmlrpc-errors">xmlrpc_errors</link></member>
|
|
<member><function>ini_set</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|