mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-30 04:03:10 +02:00
b8daeaab85
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@78204 c90b9560-bf6c-de11-be94-00142212c4b1
156 lines
4.9 KiB
XML
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 être un champs
|
|
de bits, ou une constante. L'utilisation des constantes est vivement
|
|
recommandée, pour assurer une compatibilité maximale avec
|
|
les futures versions. Au fur et à mesure que de nouveaux niveaux
|
|
d'erreurs sont créés, l'intervalle de validité des niveaux
|
|
évolue, et les anciennes valeurs n'ont plus les mêmes significations.
|
|
<example role="php">
|
|
<title>Exemple de modification de niveau d'erreur</title>
|
|
<programlisting role="php">
|
|
error_reporting (55); // En PHP 3, équivalent à 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 équivalent à E_ALL ^ E_NOTICE
|
|
error_reporting (E_ALL ^ E_NOTICE); // La même signification en PHP 3 et 4
|
|
</programlisting>
|
|
</example>
|
|
Suivez les liens de chaque valeur interne pour connaî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ê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ée pour les erreurs courantes d'exé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ée pour les erreurs courantes de développement
|
|
(variables non initialisé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
|
|
-->
|