reference/errorfunc/constants.xml
4c9b6ff9fbc0b2516d21a3f82ad36b91ea1d0aa4
4c9b6ff9fbc0b2516d21a3f82ad36b91ea1d0aa4
...
...
@@ -3,264 +3,343 @@
3
3
<appendix xml:id="errorfunc.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4
4
&reftitle.constants;
5
5
&extension.constants.core;
6
-
<note>
7
-
<simpara>
8
-
You may use these constant names in &php.ini; but not outside
9
-
of PHP, like in &httpd.conf;, where you'd
10
-
use the bitmask values instead.
11
-
</simpara>
12
-
</note>
13
-
<table xml:id="errorfunc.constants.errorlevels">
14
-
<title>Errors and Logging</title>
15
-
<tgroup cols="4">
16
-
<thead>
17
-
<row>
18
-
<entry>Value</entry>
19
-
<entry>Constant</entry>
20
-
<entry>Description</entry>
21
-
<entry>Note</entry>
22
-
</row>
23
-
</thead>
24
-
<tbody>
25
-
<row xml:id="errorfunc.constants.errorlevels.e-error">
26
-
<entry>1</entry>
27
-
<entry>
28
-
<constant>E_ERROR</constant>
29
-
(<type>integer</type>)
30
-
</entry>
31
-
<entry>
32
-
Fatal run-time errors. These indicate errors that can not be
33
-
recovered from, such as a memory allocation problem.
34
-
Execution of the script is halted.
35
-
</entry>
36
-
<entry></entry>
37
-
</row>
38
6
39
-
<row xml:id="errorfunc.constants.errorlevels.e-warning">
40
-
<entry>2</entry>
41
-
<entry>
42
-
<constant>E_WARNING</constant>
43
-
(<type>integer</type>)
44
-
</entry>
45
-
<entry>
46
-
Run-time warnings (non-fatal errors). Execution of the script is not
47
-
halted.
48
-
</entry>
49
-
<entry></entry>
50
-
</row>
7
+
<simpara>
8
+
The following constants (either the corresponding numerical value or their
9
+
symbolic name) are used as a bitmask to specify which errors to report.
10
+
It is possible to use
11
+
<link linkend="language.operators.bitwise">bitwise operators</link>
12
+
to combine these values or mask out certain types of errors.
13
+
</simpara>
51
14
52
-
<row xml:id="errorfunc.constants.errorlevels.e-parse">
53
-
<entry>4</entry>
54
-
<entry>
55
-
<constant>E_PARSE</constant>
56
-
(<type>integer</type>)
57
-
</entry>
58
-
<entry>
59
-
Compile-time parse errors. Parse errors should only be generated by
60
-
the parser.
61
-
</entry>
62
-
<entry></entry>
63
-
</row>
15
+
<tip>
16
+
<simpara>
17
+
The name of the constants can be used within &php.ini;,
18
+
instead of the raw numerical values to which they correspond to.
19
+
However, only the
20
+
<literal>|</literal>,
21
+
<literal>~</literal>,
22
+
<literal>^</literal>,
23
+
<literal>!</literal>,
24
+
<literal>&</literal>
25
+
operators are understood within &php.ini;.
26
+
</simpara>
27
+
</tip>
64
28
65
-
<row xml:id="errorfunc.constants.errorlevels.e-notice">
66
-
<entry>8</entry>
67
-
<entry>
68
-
<constant>E_NOTICE</constant>
69
-
(<type>integer</type>)
70
-
</entry>
71
-
<entry>
72
-
Run-time notices. Indicate that the script encountered something that
73
-
could indicate an error, but could also happen in the normal course of
74
-
running a script.
75
-
</entry>
76
-
<entry></entry>
77
-
</row>
29
+
<warning>
30
+
<simpara>
31
+
It is not possible to use the symbolic names outside of PHP.
32
+
For example in &httpd.conf; the computed bitmask value must be used instead.
33
+
</simpara>
34
+
</warning>
78
35
79
-
<row xml:id="errorfunc.constants.errorlevels.e-core-error">
80
-
<entry>16</entry>
81
-
<entry>
82
-
<constant>E_CORE_ERROR</constant>
83
-
(<type>integer</type>)
84
-
</entry>
85
-
<entry>
86
-
Fatal errors that occur during PHP's initial startup. This is like an
87
-
<constant>E_ERROR</constant>, except it is generated by the core of PHP.
88
-
</entry>
89
-
<entry></entry>
90
-
</row>
36
+
<variablelist xml:id="errorfunc.constants.errorlevels">
37
+
<varlistentry xml:id="constant.e-error">
38
+
<term>
39
+
<constant>E_ERROR</constant>
40
+
(<type>int</type>)
41
+
</term>
42
+
<listitem>
43
+
<simpara>
44
+
Fatal run-time errors.
45
+
These indicate errors that can not be recovered from,
46
+
such as a memory allocation problem.
47
+
Execution of the script is halted.
48
+
</simpara>
49
+
<simpara>
50
+
Value of the constant: <literal>1</literal>
51
+
</simpara>
52
+
</listitem>
53
+
</varlistentry>
91
54
92
-
<row xml:id="errorfunc.constants.errorlevels.e-core-warning">
93
-
<entry>32</entry>
94
-
<entry>
95
-
<constant>E_CORE_WARNING</constant>
96
-
(<type>integer</type>)
97
-
</entry>
98
-
<entry>
99
-
Warnings (non-fatal errors) that occur during PHP's initial startup.
100
-
This is like an <constant>E_WARNING</constant>, except it is generated
101
-
by the core of PHP.
102
-
</entry>
103
-
<entry></entry>
104
-
</row>
55
+
<varlistentry xml:id="constant.e-warning">
56
+
<term>
57
+
<constant>E_WARNING</constant>
58
+
(<type>int</type>)
59
+
</term>
60
+
<listitem>
61
+
<simpara>
62
+
Run-time warnings (non-fatal errors).
63
+
Execution of the script is not halted.
64
+
</simpara>
65
+
<simpara>
66
+
Value of the constant: <literal>2</literal>
67
+
</simpara>
68
+
</listitem>
69
+
</varlistentry>
105
70
106
-
<row xml:id="errorfunc.constants.errorlevels.e-compile-error">
107
-
<entry>64</entry>
108
-
<entry>
109
-
<constant>E_COMPILE_ERROR</constant>
110
-
(<type>integer</type>)
111
-
</entry>
112
-
<entry>
113
-
Fatal compile-time errors. This is like an <constant>E_ERROR</constant>,
114
-
except it is generated by the Zend Scripting Engine.
115
-
</entry>
116
-
<entry></entry>
117
-
</row>
71
+
<varlistentry xml:id="constant.e-parse">
72
+
<term>
73
+
<constant>E_PARSE</constant>
74
+
(<type>int</type>)
75
+
</term>
76
+
<listitem>
77
+
<simpara>
78
+
Compile-time parse errors.
79
+
Parse errors should only be generated by the parser.
80
+
</simpara>
81
+
<simpara>
82
+
Value of the constant: <literal>4</literal>
83
+
</simpara>
84
+
</listitem>
85
+
</varlistentry>
118
86
119
-
<row xml:id="errorfunc.constants.errorlevels.e-compile-warning">
120
-
<entry>128</entry>
121
-
<entry>
122
-
<constant>E_COMPILE_WARNING</constant>
123
-
(<type>integer</type>)
124
-
</entry>
125
-
<entry>
126
-
Compile-time warnings (non-fatal errors). This is like an
127
-
<constant>E_WARNING</constant>, except it is generated by the Zend
128
-
Scripting Engine.
129
-
</entry>
130
-
<entry></entry>
131
-
</row>
87
+
<varlistentry xml:id="constant.e-notice">
88
+
<term>
89
+
<constant>E_NOTICE</constant>
90
+
(<type>int</type>)
91
+
</term>
92
+
<listitem>
93
+
<simpara>
94
+
Run-time notices.
95
+
Indicate that the script encountered something that could indicate an error,
96
+
but could also happen in the normal course of running a script.
97
+
</simpara>
98
+
<simpara>
99
+
Value of the constant: <literal>8</literal>
100
+
</simpara>
101
+
</listitem>
102
+
</varlistentry>
132
103
133
-
<row xml:id="errorfunc.constants.errorlevels.e-user-error">
134
-
<entry>256</entry>
135
-
<entry>
136
-
<constant>E_USER_ERROR</constant>
137
-
(<type>integer</type>)
138
-
</entry>
139
-
<entry>
140
-
User-generated error message. This is like an
141
-
<constant>E_ERROR</constant>, except it is generated in PHP code by
142
-
using the PHP function <function>trigger_error</function>.
143
-
</entry>
144
-
<entry></entry>
145
-
</row>
104
+
<varlistentry xml:id="constant.e-core-error">
105
+
<term>
106
+
<constant>E_CORE_ERROR</constant>
107
+
(<type>int</type>)
108
+
</term>
109
+
<listitem>
110
+
<simpara>
111
+
Fatal errors that occur during PHP's initial startup.
112
+
This is like an <constant>E_ERROR</constant>,
113
+
except it is generated by the core of PHP.
114
+
</simpara>
115
+
<simpara>
116
+
Value of the constant: <literal>16</literal>
117
+
</simpara>
118
+
</listitem>
119
+
</varlistentry>
146
120
147
-
<row xml:id="errorfunc.constants.errorlevels.e-user-warning">
148
-
<entry>512</entry>
149
-
<entry>
150
-
<constant>E_USER_WARNING</constant>
151
-
(<type>integer</type>)
152
-
</entry>
153
-
<entry>
154
-
User-generated warning message. This is like an
155
-
<constant>E_WARNING</constant>, except it is generated in PHP code by
156
-
using the PHP function <function>trigger_error</function>.
157
-
</entry>
158
-
<entry></entry>
159
-
</row>
121
+
<varlistentry xml:id="constant.e-core-warning">
122
+
<term>
123
+
<constant>E_CORE_WARNING</constant>
124
+
(<type>int</type>)
125
+
</term>
126
+
<listitem>
127
+
<simpara>
128
+
Warnings (non-fatal errors) that occur during PHP's initial startup.
129
+
This is like an <constant>E_WARNING</constant>,
130
+
except it is generated by the core of PHP.
131
+
</simpara>
132
+
<simpara>
133
+
Value of the constant: <literal>32</literal>
134
+
</simpara>
135
+
</listitem>
136
+
</varlistentry>
160
137
161
-
<row xml:id="errorfunc.constants.errorlevels.e-user-notice">
162
-
<entry>1024</entry>
163
-
<entry>
164
-
<constant>E_USER_NOTICE</constant>
165
-
(<type>integer</type>)
166
-
</entry>
167
-
<entry>
168
-
User-generated notice message. This is like an
169
-
<constant>E_NOTICE</constant>, except it is generated in PHP code by
170
-
using the PHP function <function>trigger_error</function>.
171
-
</entry>
172
-
<entry></entry>
173
-
</row>
138
+
<varlistentry xml:id="constant.e-compile-error">
139
+
<term>
140
+
<constant>E_COMPILE_ERROR</constant>
141
+
(<type>int</type>)
142
+
</term>
143
+
<listitem>
144
+
<simpara>
145
+
Fatal compile-time errors.
146
+
This is like an <constant>E_ERROR</constant>,
147
+
except it is generated by the Zend Scripting Engine.
148
+
</simpara>
149
+
<simpara>
150
+
Value of the constant: <literal>64</literal>
151
+
</simpara>
152
+
</listitem>
153
+
</varlistentry>
174
154
175
-
<row xml:id="errorfunc.constants.errorlevels.e-strict">
176
-
<entry>2048</entry>
177
-
<entry>
178
-
<constant>E_STRICT</constant>
179
-
(<type>integer</type>)
180
-
</entry>
181
-
<entry>
182
-
Enable to have PHP suggest changes
183
-
to your code which will ensure the best interoperability
184
-
and forward compatibility of your code.
185
-
</entry>
186
-
<entry>Since PHP 5 but not included in <constant>E_ALL</constant> until PHP 5.4.0</entry>
187
-
</row>
155
+
<varlistentry xml:id="constant.e-compile-warning">
156
+
<term>
157
+
<constant>E_COMPILE_WARNING</constant>
158
+
(<type>int</type>)
159
+
</term>
160
+
<listitem>
161
+
<simpara>
162
+
Compile-time warnings (non-fatal errors).
163
+
This is like an <constant>E_WARNING</constant>,
164
+
except it is generated by the Zend Scripting Engine.
165
+
</simpara>
166
+
<simpara>
167
+
Value of the constant: <literal>128</literal>
168
+
</simpara>
169
+
</listitem>
170
+
</varlistentry>
188
171
189
-
<row xml:id="errorfunc.constants.errorlevels.e-recoverable-error">
190
-
<entry>4096</entry>
191
-
<entry>
192
-
<constant>E_RECOVERABLE_ERROR</constant>
193
-
(<type>integer</type>)
194
-
</entry>
195
-
<entry>
196
-
Catchable fatal error. It indicates that a probably dangerous error
197
-
occurred, but did not leave the Engine in an unstable state. If the error
198
-
is not caught by a user defined handle (see also
199
-
<function>set_error_handler</function>), the application aborts as it
200
-
was an <constant>E_ERROR</constant>.
201
-
</entry>
202
-
<entry>Since PHP 5.2.0</entry>
203
-
</row>
172
+
<varlistentry xml:id="constant.e-deprecated">
173
+
<term>
174
+
<constant>E_DEPRECATED</constant>
175
+
(<type>int</type>)
176
+
</term>
177
+
<listitem>
178
+
<simpara>
179
+
Run-time deprecation notices.
180
+
Enable this to receive warnings about code
181
+
that will not work in future versions.
182
+
</simpara>
183
+
<simpara>
184
+
Value of the constant: <literal>8192</literal>
185
+
</simpara>
186
+
</listitem>
187
+
</varlistentry>
204
188
205
-
<row xml:id="errorfunc.constants.errorlevels.e-deprecated-error">
206
-
<entry>8192</entry>
207
-
<entry>
208
-
<constant>E_DEPRECATED</constant>
209
-
(<type>integer</type>)
210
-
</entry>
211
-
<entry>
212
-
Run-time notices. Enable this to receive warnings about code
213
-
that will not work in future versions.
214
-
</entry>
215
-
<entry>Since PHP 5.3.0</entry>
216
-
</row>
189
+
<varlistentry xml:id="constant.e-user-error">
190
+
<term>
191
+
<constant>E_USER_ERROR</constant>
192
+
(<type>int</type>)
193
+
</term>
194
+
<listitem>
195
+
<simpara>
196
+
User-generated error message.
197
+
This is like an <constant>E_ERROR</constant>,
198
+
except it is generated in PHP code by using the PHP function
199
+
<function>trigger_error</function>.
200
+
</simpara>
201
+
<simpara>
202
+
Value of the constant: <literal>256</literal>
203
+
</simpara>
204
+
<warning>
205
+
<simpara>
206
+
Usage of this constant with <function>trigger_error</function> is
207
+
deprecated as of PHP 8.4.0.
208
+
It is recommended to either &throw; an <exceptionname>Exception</exceptionname>
209
+
or call <function>exit</function> instead.
210
+
</simpara>
211
+
</warning>
212
+
</listitem>
213
+
</varlistentry>
217
214
218
-
<row xml:id="errorfunc.constants.errorlevels.e-user-deprecated">
219
-
<entry>16384</entry>
220
-
<entry>
221
-
<constant>E_USER_DEPRECATED</constant>
222
-
(<type>integer</type>)
223
-
</entry>
224
-
<entry>
225
-
User-generated warning message. This is like an
226
-
<constant>E_DEPRECATED</constant>, except it is generated in PHP code by
227
-
using the PHP function <function>trigger_error</function>.
228
-
</entry>
229
-
<entry>Since PHP 5.3.0</entry>
230
-
</row>
215
+
<varlistentry xml:id="constant.e-user-warning">
216
+
<term>
217
+
<constant>E_USER_WARNING</constant>
218
+
(<type>int</type>)
219
+
</term>
220
+
<listitem>
221
+
<simpara>
222
+
User-generated warning message.
223
+
This is like an <constant>E_WARNING</constant>,
224
+
except it is generated in PHP code by using the PHP function
225
+
<function>trigger_error</function>.
226
+
</simpara>
227
+
<simpara>
228
+
Value of the constant: <literal>512</literal>
229
+
</simpara>
230
+
</listitem>
231
+
</varlistentry>
231
232
232
-
<row xml:id="errorfunc.constants.errorlevels.e-all">
233
-
<entry>32767</entry>
234
-
<entry>
235
-
<constant>E_ALL</constant>
236
-
(<type>integer</type>)
237
-
</entry>
238
-
<entry>
239
-
All errors and warnings, as supported, except of level
240
-
<constant>E_STRICT</constant> prior to PHP 5.4.0.
241
-
</entry>
242
-
<entry>
243
-
32767 in PHP 5.4.x,
244
-
30719 in PHP 5.3.x,
245
-
6143 in PHP 5.2.x,
246
-
2047 previously
247
-
</entry>
248
-
</row>
233
+
<varlistentry xml:id="constant.e-user-notice">
234
+
<term>
235
+
<constant>E_USER_NOTICE</constant>
236
+
(<type>int</type>)
237
+
</term>
238
+
<listitem>
239
+
<simpara>
240
+
User-generated notice message.
241
+
This is like an <constant>E_NOTICE</constant>,
242
+
except it is generated in PHP code by using the PHP function
243
+
<function>trigger_error</function>.
244
+
</simpara>
245
+
<simpara>
246
+
Value of the constant: <literal>1024</literal>
247
+
</simpara>
248
+
</listitem>
249
+
</varlistentry>
249
250
250
-
</tbody>
251
-
</tgroup>
252
-
</table>
251
+
<varlistentry xml:id="constant.e-user-deprecated">
252
+
<term>
253
+
<constant>E_USER_DEPRECATED</constant>
254
+
(<type>int</type>)
255
+
</term>
256
+
<listitem>
257
+
<simpara>
258
+
User-generated deprecation message.
259
+
This is like an <constant>E_DEPRECATED</constant>,
260
+
except it is generated in PHP code by using the PHP function
261
+
<function>trigger_error</function>.
262
+
</simpara>
263
+
<simpara>
264
+
Value of the constant: <literal>16384</literal>
265
+
</simpara>
266
+
</listitem>
267
+
</varlistentry>
253
268
254
-
<para>
255
-
The above values (either numerical or symbolic) are used to build
256
-
up a bitmask that specifies which errors to report. You can use the
257
-
<link linkend="language.operators.bitwise">bitwise operators</link>
258
-
to combine these values or mask out certain types of errors. Note
259
-
that only '|', '~', '!', '^' and '&' will be understood within
260
-
&php.ini;.
261
-
</para>
262
-
</appendix>
269
+
<varlistentry xml:id="constant.e-strict">
270
+
<term>
271
+
<constant>E_STRICT</constant>
272
+
(<type>int</type>)
273
+
</term>
274
+
<listitem>
275
+
<simpara>
276
+
Run-time suggestions emitted by PHP about the executed code
277
+
to ensure forward compatibility.
278
+
</simpara>
279
+
<simpara>
280
+
Value of the constant: <literal>2048</literal>
281
+
</simpara>
282
+
<warning>
283
+
<simpara>
284
+
This error level is unused,
285
+
and has been deprecated as of PHP 8.4.0.
286
+
</simpara>
287
+
</warning>
288
+
</listitem>
289
+
</varlistentry>
263
290
291
+
<varlistentry xml:id="constant.e-recoverable-error">
292
+
<term>
293
+
<constant>E_RECOVERABLE_ERROR</constant>
294
+
(<type>int</type>)
295
+
</term>
296
+
<listitem>
297
+
<simpara>
298
+
Legacy engine "exceptions" which correspond to catchable fatal error.
299
+
Similar to <exceptionname>Error</exceptionname> but must be caught via a
300
+
user defined error handler (see <function>set_error_handler</function>).
301
+
If not handled, this behaves like <constant>E_ERROR</constant>.
302
+
</simpara>
303
+
<simpara>
304
+
Value of the constant: <literal>4096</literal>
305
+
</simpara>
306
+
<note>
307
+
<simpara>
308
+
This error level is effectively unused,
309
+
the only case where this can happen is when interpreting an
310
+
&object; as a <type>bool</type> fails.
311
+
This can only happen for internal objects.
312
+
</simpara>
313
+
<simpara>
314
+
The most common example, prior to PHP 8.4.0, is using a
315
+
<classname>GMP</classname> instance in a conditional.
316
+
</simpara>
317
+
</note>
318
+
</listitem>
319
+
</varlistentry>
320
+
321
+
<varlistentry xml:id="constant.e-all">
322
+
<term>
323
+
<constant>E_ALL</constant>
324
+
(<type>int</type>)
325
+
</term>
326
+
<listitem>
327
+
<simpara>
328
+
Bit-mask that contains every single error, warning, and notice.
329
+
</simpara>
330
+
<simpara>
331
+
Value of the constant: <literal>30719</literal>
332
+
</simpara>
333
+
<warning>
334
+
<simpara>
335
+
Prior to PHP 8.4, the constant value was: <literal>32767</literal>
336
+
</simpara>
337
+
</warning>
338
+
</listitem>
339
+
</varlistentry>
340
+
341
+
</variablelist>
342
+
</appendix>
264
343
<!-- Keep this comment at the end of the file
265
344
Local variables:
266
345
mode: sgml
267
346