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,10 +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>
64
+
</refsect1>
65
+

66
+
<refsect1 role="changelog">
67
+
&reftitle.changelog;
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>
58
86
</refsect1>
59
87

60
88
<refsect1 role="examples">
...
...
@@ -97,19 +125,11 @@ ini_set('error_reporting', E_ALL);
97
125

98
126
<refsect1 role="notes">
99
127
&reftitle.notes;
100
-
<warning>
101
-
<simpara>
102
-
Most of <constant>E_STRICT</constant> errors are evaluated at the
103
-
compile time thus such errors are not reported in the file where
104
-
<link linkend="ini.error-reporting">error_reporting</link> is enhanced
105
-
to include <constant>E_STRICT</constant> errors (and vice versa).
106
-
</simpara>
107
-
</warning>
108
128
<tip>
109
129
<simpara>
110
130
Passing in the value <literal>-1</literal> will show every possible error,
111
131
even when new levels and constants are added in future PHP versions. The
112
-
<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.
113
133
</simpara>
114
134
</tip>
115
135
</refsect1>
...
...
@@ -121,12 +141,12 @@ ini_set('error_reporting', E_ALL);
121
141
<member>The <link linkend="ini.display-errors">display_errors</link> directive</member>
122
142
<member>The <link linkend="ini.html-errors">html_errors</link> directive</member>
123
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>
124
145
<member><function>ini_set</function></member>
125
146
</simplelist>
126
147
</para>
127
148
</refsect1>
128
149
</refentry>
129
-

130
150
<!-- Keep this comment at the end of the file
131
151
Local variables:
132
152
mode: sgml
133
153