Files
doc-fr/reference/errorfunc/functions/error-reporting.xml
T
Hartmut Holzgraefe b8daeaab85 banana-split
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@78204 c90b9560-bf6c-de11-be94-00142212c4b1
2002-04-15 00:40:38 +00:00

156 lines
4.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- splitted from ./fr/functions/errorfunc.xml, last change in rev 1.2 -->
<!-- last change to 'error-reporting' in en/ tree in rev 1.1 -->
<refentry id="function.error-reporting">
<refnamediv>
<refname>error_reporting</refname>
<refpurpose>Fixe le niveau de rapport d'erreurs PHP</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>error_reporting</methodname>
<methodparam choice="opt"><type>int</type><parameter>level</parameter></methodparam>
</methodsynopsis>
<para>
<function>error_reporting</function> fixe le niveau de rapport d'erreur PHP
et retourne l'ancienne valeur. Le niveau d'erreur peut &ecirc;tre un champs
de bits, ou une constante. L'utilisation des constantes est vivement
recommand&eacute;e, pour assurer une compatibilit&eacute; maximale avec
les futures versions. Au fur et &agrave; mesure que de nouveaux niveaux
d'erreurs sont cr&eacute;&eacute;s, l'intervalle de validit&eacute; des niveaux
&eacute;volue, et les anciennes valeurs n'ont plus les m&ecirc;mes significations.
<example role="php">
<title>Exemple de modification de niveau d'erreur</title>
<programlisting role="php">
error_reporting (55); // En PHP 3, &eacute;quivalent &agrave; E_ALL ^ E_NOTICE
/* ...en PHP 4, '55' signifie (E_ERROR | E_WARNING | E_PARSE |
E_CORE_ERROR | E_CORE_WARNING) */
error_reporting (2039); // PHP 4 &eacute;quivalent &agrave; E_ALL ^ E_NOTICE
error_reporting (E_ALL ^ E_NOTICE); // La m&ecirc;me signification en PHP 3 et 4
</programlisting>
</example>
Suivez les liens de chaque valeur interne pour conna&icirc;tre leur signification :
<table>
<title>Constantes avec <function>error_reporting</function></title>
<tgroup cols="2">
<thead>
<row>
<entry>constante</entry>
<entry>valeur</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>64</entry>
<entry>
<link linkend="internal.e-compile-error">E_COMPILE_ERROR</link>
</entry>
</row>
<row>
<entry>128</entry>
<entry>
<link linkend="internal.e-compile-warning">E_COMPILE_WARNING</link>
</entry>
</row>
<row>
<entry>256</entry>
<entry>
<link linkend="internal.e-user-error">E_USER_ERROR</link>
</entry>
</row>
<row>
<entry>512</entry>
<entry>
<link linkend="internal.e-user-warning">E_USER_WARNING</link>
</entry>
</row>
<row>
<entry>1024</entry>
<entry>
<link linkend="internal.e-user-error">E_USER_NOTICE</link>
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
<example role="php">
<title>Exemples avec <function>error_reporting</function></title>
<programlisting role="php">
error_reporting(0);
/* Emp&ecirc;che tout affichage d'erreur */
error_reporting(7); // Ancienne syntaxe PHP 2/3
error_reporting(E_ERROR | E_WARNING | E_PARSE); // Nouvelle syntaxe PHP 3/4
/* Utilisation appropri&eacute;e pour les erreurs courantes d'ex&eacute;cution */
error_reporting(15); // Ancienne syntaxe, PHP 2/3
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // Nouvelle syntaxe PHP 3/4
/* Utilisation appropri&eacute;e pour les erreurs courantes de d&eacute;veloppement
(variables non initialis&eacute;es..)*/
error_reporting(63); // Ancienne syntaxe, PHP 2/3
error_reporting(E_ALL); // Nouvelle syntaxe PHP 3/4
/* rapporte toutes les erreurs PHP*/
</programlisting>
</example>
</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:"../../../../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
-->