Date: 07/30/00
- Next message: Luca Perugini: "[PHP-DOC] cvs: phpdoc /it/features error-handling.xml"
- Previous message: Luca Perugini: "[PHP-DOC] cvs: phpdoc /it/chapters install.xml"
- Next in thread: Luca Perugini: "[PHP-DOC] cvs: phpdoc /it/features error-handling.xml"
- Maybe reply: Luca Perugini: "[PHP-DOC] cvs: phpdoc /it/features error-handling.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
perugini Sun Jul 30 17:37:36 2000 EDT
Modified files:
/phpdoc/it/features error-handling.xml
Log:
Uptaded from english tree.
Index: phpdoc/it/features/error-handling.xml
diff -u phpdoc/it/features/error-handling.xml:1.1 phpdoc/it/features/error-handling.xml:1.2
--- phpdoc/it/features/error-handling.xml:1.1 Sat Dec 18 17:00:07 1999
+++ phpdoc/it/features/error-handling.xml Sun Jul 30 17:37:36 2000
@@ -1,33 +1,142 @@
- <chapter id="features.error-handling">
- <title>Error handling</title>
+<chapter id="features.error-handling">
+ <title>Error handling</title>
+
+ <para>
+ There are several types of errors and warnings in PHP. They are:
- <para>
- There are 4 types of errors and warnings in PHP. They are:
+ <table>
+ <title>PHP error types</title>
+ <tgroup cols="4">
+ <thead>
+ <row>
+ <entry>value</entry>
+ <entry>symbolic</entry>
+ <entry>description</entry>
+ <entry>note</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>1</entry>
+ <entry>E_ERROR</entry>
+ <entry>fatal run-time errors</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>2</entry>
+ <entry>E_WARNING</entry>
+ <entry>run-time warnings (non fatal errors)</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>4</entry>
+ <entry>E_PARSE</entry>
+ <entry>compile-time parse errors</entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>8</entry>
+ <entry>E_NOTICE </entry>
+ <entry>
+ run-time notices (less serious than warnings)
+ </entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry>16</entry>
+ <entry>E_CORE_ERROR</entry>
+ <entry>fatal errors that occur during PHP's initial startup</entry>
+ <entry>PHP 4 only</entry>
+ </row>
+ <row>
+ <entry>32</entry>
+ <entry>E_CORE_WARNING</entry>
+ <entry>warnings (non fatal errors) that occur during PHP's initial startup</entry>
+ <entry>PHP 4 only</entry>
+ </row>
+ <row>
+ <entry>64</entry>
+ <entry>E_COMPILE_ERROR</entry>
+ <entry>fatal compile-time errors</entry>
+ <entry>PHP 4 only</entry>
+ </row>
+ <row>
+ <entry>128</entry>
+ <entry>E_COMPILE_WARNING</entry>
+ <entry>ompile-time warnings (non fatal errors)</entry>
+ <entry>PHP 4 only</entry>
+ </row>
+ <row>
+ <entry>256</entry>
+ <entry>E_USER_ERROR</entry>
+ <entry>user-generated error message</entry>
+ <entry>PHP 4 only</entry>
+ </row>
+ <row>
+ <entry>512</entry>
+ <entry>E_USER_WARNING</entry>
+ <entry>user-generated warning message</entry>
+ <entry>PHP 4 only</entry>
+ </row>
+ <row>
+ <entry>1024</entry>
+ <entry>E_USER_NOTICE </entry>
+ <entry>user-generated notice message</entry>
+ <entry>PHP 4 only</entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>E_ALL</entry>
+ <entry>all of the above</entry>
+ <entry>PHP 4 only</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
- <itemizedlist>
- <listitem><simpara>1 - Normal Function Errors</simpara></listitem>
- <listitem><simpara>2 - Normal Warnings</simpara></listitem>
- <listitem><simpara>4 - Parser Errors</simpara></listitem>
- <listitem><simpara>8 - Notices (warnings you can ignore but which
- may imply a bug in your code)</simpara></listitem>
- </itemizedlist></para>
+ <para>
+ The above values (either numerical or sombolic) are used to build up a
+ bitmask that specifies which errors to report. You can use the bitwise
+ operators '|','&' and '~' to combine theese values or mask out certain
+ types of errors. The default settings that will report anything but notice
+ messages are <literal>E_ALL & ~E_NOTICE</literal> for PHP4 and 7 for PHP 3
+ (PHP 3 does not support the symbolic constants).
+ </para>
- <simpara>
- The above 4 numbers are added up to define an error reporting
- level. The default error reporting level is 7 which is 1 + 2 + 4,
- or everything except notices. This level can be changed in the
- php3.ini file with the error_reporting directive. It can also be
- set in your Apache httpd.conf file with the php3_error_reporting
- directive or lastly it may be set at runtime within a script using
- the <function>error_reporting</function> function.</simpara>
+ <para>
+ The settings can be changed in the ini file with the error_reporting
+ directive. It can also be set in your Apache httpd.conf file with
+ the php_error_reporting (php3_error_reporting for PHP 3)
+ directive or lastly it may be set at runtime within a script using
+ the <function>error_reporting</function> function.
+ </para>
+
+ <warning>
+ <para>
+ When upgrading code or servers from PHP 3 to PHP 4 you should check
+ theese settings and calls to <function>error_reporting</function> or
+ you might disable reporting the new error types, especially E_COMPILE_ERROR.
+ This may lead to empty documents without any feedback of what happened
+ or where to look for the problem.
+ </para>
+ </warning>
- <simpara>
+ <para>
All <link linkend="language.expressions">PHP expressions</link> can also be called
with the "@" prefix, which turns off error reporting for that particular
expression. If an error occurred during such an expression and the
<link linkend="ini.track-errors">track_errors</link> feature
is enabled, you can find the error message in the global variable
- $php_errormsg.</simpara>
+ $php_errormsg.
+ </para>
+
+ <warning>
+ <para>
+ Currently the "@" prefix will even disable error reporting for critical
+ errors that will terminate script execution.
+ </para>
+ </warning>
</chapter>
- Next message: Luca Perugini: "[PHP-DOC] cvs: phpdoc /it/features error-handling.xml"
- Previous message: Luca Perugini: "[PHP-DOC] cvs: phpdoc /it/chapters install.xml"
- Next in thread: Luca Perugini: "[PHP-DOC] cvs: phpdoc /it/features error-handling.xml"
- Maybe reply: Luca Perugini: "[PHP-DOC] cvs: phpdoc /it/features error-handling.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

