reference/errorfunc/functions/error-reporting.xml
9caac4c5cce859b4ae5d497972442fcfaa840d81
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.error-reporting">
3
+
<refentry xml:id="function.error-reporting" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>error_reporting</refname>
6
6
<refpurpose>Sets which PHP errors are reported</refpurpose>
...
...
@@ -10,14 +10,14 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>int</type><methodname>error_reporting</methodname>
13
-
<methodparam choice="opt"><type>int</type><parameter>level</parameter></methodparam>
13
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>error_level</parameter><initializer>&null;</initializer></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
16
The <function>error_reporting</function> function sets the
17
17
<link linkend="ini.error-reporting">error_reporting</link>
18
18
directive at runtime. PHP has many levels of errors, using
19
19
this function sets that level for the duration (runtime) of
20
-
your script. If the optional <parameter>level</parameter> is
20
+
your script. If the optional <parameter>error_level</parameter> is
21
21
not set, <function>error_reporting</function> will just return
22
22
the current error reporting level.
23
23
</para>
...
...
@@ -28,7 +28,7 @@
28
28
<para>
29
29
<variablelist>
30
30
<varlistentry>
31
-
<term><parameter>level</parameter></term>
31
+
<term><parameter>error_level</parameter></term>
32
32
<listitem>
33
33
<para>
34
34
The new <link linkend="ini.error-reporting">error_reporting</link>
...
...
@@ -51,40 +51,38 @@
51
51
<refsect1 role="returnvalues">
52
52
&reftitle.returnvalues;
53
53
<para>
54
-
Returns the old <link linkend="ini.error-reporting">error_reporting</link>
55
-
level or the current level if no <parameter>level</parameter> parameter is
56
-
given.
54
+
Returns the <link linkend="ini.error-reporting">error_reporting</link>
55
+
level, <emphasis>before</emphasis> it is changed to
56
+
<parameter>error_level</parameter>.
57
57
</para>
58
+
<note>
59
+
<simpara>
60
+
The <link linkend="language.operators.errorcontrol">error control</link>
61
+
<literal>@</literal>-operator changes the <parameter>error_level</parameter> during error handling.
62
+
</simpara>
63
+
</note>
58
64
</refsect1>
59
65

60
66
<refsect1 role="changelog">
61
67
&reftitle.changelog;
62
-
<para>
63
-
<informaltable>
64
-
<tgroup cols="2">
65
-
<thead>
66
-
<row>
67
-
<entry>&Version;</entry>
68
-
<entry>&Description;</entry>
69
-
</row>
70
-
</thead>
71
-
<tbody>
72
-
<row>
73
-
<entry>5.4.0</entry>
74
-
<entry><constant>E_STRICT</constant> became part of <constant>E_ALL</constant>.</entry>
75
-
</row>
76
-
<row>
77
-
<entry>5.3.0</entry>
78
-
<entry><constant>E_DEPRECATED</constant> and <constant>E_USER_DEPRECATED</constant> introduced.</entry>
79
-
</row>
80
-
<row>
81
-
<entry>5.2.0</entry>
82
-
<entry><constant>E_RECOVERABLE_ERROR</constant> introduced.</entry>
83
-
</row>
84
-
</tbody>
85
-
</tgroup>
86
-
</informaltable>
87
-
</para>
68
+
<informaltable>
69
+
<tgroup cols="2">
70
+
<thead>
71
+
<row>
72
+
<entry>&Version;</entry>
73
+
<entry>&Description;</entry>
74
+
</row>
75
+
</thead>
76
+
<tbody>
77
+
<row>
78
+
<entry>8.0.0</entry>
79
+
<entry>
80
+
<parameter>error_level</parameter> is nullable now.
81
+
</entry>
82
+
</row>
83
+
</tbody>
84
+
</tgroup>
85
+
</informaltable>
88
86
</refsect1>
89
87

90
88
<refsect1 role="examples">
...
...
@@ -109,7 +107,7 @@ error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
109
107
// Report all errors except E_NOTICE
110
108
error_reporting(E_ALL & ~E_NOTICE);
111
109

112
-
// Report all PHP errors (see changelog)
110
+
// Report all PHP errors
113
111
error_reporting(E_ALL);
114
112

115
113
// Report all PHP errors
...
...
@@ -127,19 +125,11 @@ ini_set('error_reporting', E_ALL);
127
125

128
126
<refsect1 role="notes">
129
127
&reftitle.notes;
130
-
<warning>
131
-
<simpara>
132
-
Most of <constant>E_STRICT</constant> errors are evaluated at the
133
-
compile time thus such errors are not reported in the file where
134
-
<link linkend="ini.error-reporting">error_reporting</link> is enhanced
135
-
to include <constant>E_STRICT</constant> errors (and vice versa).
136
-
</simpara>
137
-
</warning>
138
128
<tip>
139
129
<simpara>
140
130
Passing in the value <literal>-1</literal> will show every possible error,
141
131
even when new levels and constants are added in future PHP versions. The
142
-
<constant>E_ALL</constant> constant also behaves this way as of PHP 5.4.
132
+
behavior is equivalent to passing <constant>E_ALL</constant> constant.
143
133
</simpara>
144
134
</tip>
145
135
</refsect1>
...
...
@@ -151,12 +141,12 @@ ini_set('error_reporting', E_ALL);
151
141
<member>The <link linkend="ini.display-errors">display_errors</link> directive</member>
152
142
<member>The <link linkend="ini.html-errors">html_errors</link> directive</member>
153
143
<member>The <link linkend="ini.xmlrpc-errors">xmlrpc_errors</link> directive</member>
144
+
<member>The <link linkend="language.operators.errorcontrol">error control</link> operator</member>
154
145
<member><function>ini_set</function></member>
155
146
</simplelist>
156
147
</para>
157
148
</refsect1>
158
149
</refentry>
159
-

160
150
<!-- Keep this comment at the end of the file
161
151
Local variables:
162
152
mode: sgml
163
153