appendices/tokens.xml
270a871223343be9280a3e8a133a5467a3e82908
...
...
@@ -4,30 +4,38 @@
4
4
<appendix xml:id="tokens" xmlns="http://docbook.org/ns/docbook">
5
5
<title>List of Parser Tokens</title>
6
6
<para>
7
-
Various parts of the PHP language are represented internally by types like
8
-
T_SR. PHP outputs identifiers like this one in parse errors, like
9
-
<literal>"Parse error: unexpected T_SR, expecting ',' or ';' in script.php on line 10."</literal>
7
+
Various parts of the PHP language are represented internally by tokens.
8
+
A code snippet that contains an invalid sequence of tokens may lead to errors like
9
+
<literal>Parse error: syntax error, unexpected token "==", expecting "(" in script.php on line 10."</literal>
10
+
where token <code>==</code> is internally represented by <constant>T_IS_EQUAL</constant>.
10
11
</para>
12
+

11
13
<para>
12
-
You're supposed to know what T_SR means. For everybody who doesn't
13
-
know that, here is a table with those identifiers, PHP-syntax and
14
-
references to the appropriate places in the manual.
14
+
The following table lists all tokens. They are also available as PHP constants.
15
15
</para>
16
16

17
17
<note>
18
18
<title>Usage of T_* constants</title>
19
19
<para>
20
-
All tokens listed below are also defined as PHP constants. Their value is
21
-
automatically generated based on PHP's underlying parser infrastructure.
20
+
T_* constants values are automatically generated based on PHP's underlying parser infrastructure.
22
21
This means that the concrete value of a token may change between two PHP
23
-
versions. For example the <constant>T_FILE</constant> constant is
24
-
<literal>365</literal> in PHP 5.3, while the same value refers now to
25
-
<constant>T_TRAIT</constant> in PHP 5.4 and the value of <constant>T_FILE</constant>
26
-
is <literal>369</literal>. This means that your code should never rely directly
22
+
versions.
23
+
This means that your code should never rely directly
27
24
on the original T_* values taken from PHP version X.Y.Z, to provide some compatibility
28
-
across multiple PHP versions. Instead your code should utilize custom values
29
-
(using big numbers like <literal>10000</literal>) and an appropriate strategy that
30
-
will work with both PHP versions and T_* values.
25
+
across multiple PHP versions.
26
+
</para>
27
+

28
+
<para>
29
+
To make use of T_* constants across multiple PHP versions, undefined constants
30
+
may be defined by the user (using big numbers like <literal>10000</literal>) with an
31
+
appropriate strategy that will work with both PHP versions and T_* values.
32
+
<programlisting role="php">
33
+
<![CDATA[
34
+
<?php
35
+
// Prior to PHP 7.4.0, T_FN is not defined.
36
+
defined('T_FN') || define('T_FN', 10001);
37
+
]]>
38
+
</programlisting>
31
39
</para>
32
40
</note>
33
41

...
...
@@ -42,679 +50,739 @@
42
50
</row>
43
51
</thead>
44
52
<tbody>
45
-
<row>
53
+
<row xml:id="constant.t-abstract">
46
54
<entry><constant>T_ABSTRACT</constant></entry>
47
55
<entry>abstract</entry>
48
56
<entry><xref linkend="language.oop5.abstract"/></entry>
49
57
</row>
50
-
<row>
58
+
<row xml:id="constant.t-ampersand-followed-by-var-or-vararg">
59
+
<entry><constant>T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG</constant></entry>
60
+
<entry>&amp;</entry>
61
+
<entry><xref linkend="language.types.declarations"/> (available as of PHP 8.1.0)</entry>
62
+
</row>
63
+
<row xml:id="constant.t-ampersand-not-followed-by-var-or-vararg">
64
+
<entry><constant>T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG</constant></entry>
65
+
<entry>&amp;</entry>
66
+
<entry><xref linkend="language.types.declarations"/> (available as of PHP 8.1.0)</entry>
67
+
</row>
68
+
<row xml:id="constant.t-and-equal">
51
69
<entry><constant>T_AND_EQUAL</constant></entry>
52
70
<entry>&amp;=</entry>
53
71
<entry><link linkend="language.operators.assignment">assignment
54
72
operators</link></entry>
55
73
</row>
56
-
<row>
74
+
<row xml:id="constant.t-array">
57
75
<entry><constant>T_ARRAY</constant></entry>
58
76
<entry>array()</entry>
59
77
<entry><function>array</function>, <link
60
78
linkend="language.types.array.syntax">array syntax</link></entry>
61
79
</row>
62
-
<row>
80
+
<row xml:id="constant.t-array-cast">
63
81
<entry><constant>T_ARRAY_CAST</constant></entry>
64
82
<entry>(array)</entry>
65
83
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
66
84
</row>
67
-
<row>
85
+
<row xml:id="constant.t-as">
68
86
<entry><constant>T_AS</constant></entry>
69
87
<entry>as</entry>
70
88
<entry>&foreach;</entry>
71
89
</row>
72
-
<row>
90
+
<row xml:id="constant.t-attribute">
91
+
<entry><constant>T_ATTRIBUTE</constant></entry>
92
+
<entry>#[</entry>
93
+
<entry><link linkend="language.attributes">attributes</link> (available as of PHP 8.0.0)</entry>
94
+
</row>
95
+
<row xml:id="constant.t-bad-character">
73
96
<entry><constant>T_BAD_CHARACTER</constant></entry>
74
97
<entry></entry>
75
98
<entry>
76
99
anything below ASCII 32 except \t (0x09), \n (0x0a) and \r (0x0d)
77
-
(available since PHP 7.4.0)
100
+
(available as of PHP 7.4.0)
78
101
</entry>
79
102
</row>
80
-
<row>
103
+
<row xml:id="constant.t-boolean-and">
81
104
<entry><constant>T_BOOLEAN_AND</constant></entry>
82
105
<entry>&amp;&amp;</entry>
83
106
<entry><link linkend="language.operators.logical">logical operators</link></entry>
84
107
</row>
85
-
<row>
108
+
<row xml:id="constant.t-boolean-or">
86
109
<entry><constant>T_BOOLEAN_OR</constant></entry>
87
110
<entry>||</entry>
88
111
<entry><link linkend="language.operators.logical">logical operators</link></entry>
89
112
</row>
90
-
<row>
113
+
<row xml:id="constant.t-bool-cast">
91
114
<entry><constant>T_BOOL_CAST</constant></entry>
92
115
<entry>(bool) or (boolean)</entry>
93
116
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
94
117
</row>
95
-
<row>
118
+
<row xml:id="constant.t-break">
96
119
<entry><constant>T_BREAK</constant></entry>
97
120
<entry>break</entry>
98
121
<entry><link linkend="control-structures.break">break</link></entry>
99
122
</row>
100
-
<row>
123
+
<row xml:id="constant.t-callable">
101
124
<entry><constant>T_CALLABLE</constant></entry>
102
125
<entry>callable</entry>
103
126
<entry><link linkend="language.types.callable">callable</link></entry>
104
127
</row>
105
-
<row>
128
+
<row xml:id="constant.t-case">
106
129
<entry><constant>T_CASE</constant></entry>
107
130
<entry>case</entry>
108
131
<entry><link linkend="control-structures.switch">switch</link></entry>
109
132
</row>
110
-
<row>
133
+
<row xml:id="constant.t-catch">
111
134
<entry><constant>T_CATCH</constant></entry>
112
135
<entry>catch</entry>
113
136
<entry><xref linkend="language.exceptions"/></entry>
114
137
</row>
115
-
<row>
138
+
<row xml:id="constant.t-class">
116
139
<entry><constant>T_CLASS</constant></entry>
117
140
<entry>class</entry>
118
141
<entry><link linkend="language.oop5">classes and objects</link></entry>
119
142
</row>
120
-
<row>
143
+
<row xml:id="constant.t-class-c">
121
144
<entry><constant>T_CLASS_C</constant></entry>
122
145
<entry>__CLASS__</entry>
123
146
<entry>
124
147
<link linkend="language.constants.predefined">magic constants</link>
125
148
</entry>
126
149
</row>
127
-
<row>
150
+
<row xml:id="constant.t-clone">
128
151
<entry><constant>T_CLONE</constant></entry>
129
152
<entry>clone</entry>
130
153
<entry>
131
154
<link linkend="language.oop5">classes and objects</link>
132
155
</entry>
133
156
</row>
134
-
<row>
157
+
<row xml:id="constant.t-close-tag">
135
158
<entry><constant>T_CLOSE_TAG</constant></entry>
136
159
<entry>?&gt; or %&gt;</entry>
137
160
<entry><link linkend="language.basic-syntax.phpmode">escaping
138
161
from HTML</link></entry>
139
162
</row>
140
-
<row>
163
+
<row xml:id="constant.t-coalesce">
141
164
<entry><constant>T_COALESCE</constant></entry>
142
165
<entry>??</entry>
143
166
<entry>
144
167
<link linkend="language.operators.comparison.coalesce">comparison operators</link>
145
168
</entry>
146
169
</row>
147
-
<row>
170
+
<row xml:id="constant.t-coalesce-equal">
148
171
<entry><constant>T_COALESCE_EQUAL</constant></entry>
149
172
<entry>??=</entry>
150
173
<entry>
151
174
<link linkend="language.operators.assignment">assignment operators</link>
152
-
(available since PHP 7.4.0)
175
+
(available as of PHP 7.4.0)
153
176
</entry>
154
177
</row>
155
-
<row>
178
+
<row xml:id="constant.t-comment">
156
179
<entry><constant>T_COMMENT</constant></entry>
157
180
<entry>// or #, and /* */</entry>
158
181
<entry><link linkend="language.basic-syntax.comments">comments</link></entry>
159
182
</row>
160
-
<row>
183
+
<row xml:id="constant.t-concat-equal">
161
184
<entry><constant>T_CONCAT_EQUAL</constant></entry>
162
185
<entry>.=</entry>
163
186
<entry><link linkend="language.operators.assignment">assignment
164
187
operators</link></entry>
165
188
</row>
166
-
<row>
189
+
<row xml:id="constant.t-const">
167
190
<entry><constant>T_CONST</constant></entry>
168
191
<entry>const</entry>
169
192
<entry><link linkend="language.constants">class constants</link></entry>
170
193
</row>
171
-
<row>
194
+
<row xml:id="constant.t-constant-encapsed-string">
172
195
<entry><constant>T_CONSTANT_ENCAPSED_STRING</constant></entry>
173
196
<entry>"foo" or 'bar'</entry>
174
197
<entry><link linkend="language.types.string.syntax">string syntax</link></entry>
175
198
</row>
176
-
<row>
199
+
<row xml:id="constant.t-continue">
177
200
<entry><constant>T_CONTINUE</constant></entry>
178
201
<entry>continue</entry>
179
202
<entry><link linkend="control-structures.continue">continue</link></entry>
180
203
</row>
181
-
<row>
204
+
<row xml:id="constant.t-curly-open">
182
205
<entry><constant>T_CURLY_OPEN</constant></entry>
183
206
<entry>{$</entry>
184
207
<entry><link linkend="language.types.string.parsing.complex">complex
185
208
variable parsed syntax</link></entry>
186
209
</row>
187
-
<row>
210
+
<row xml:id="constant.t-dec">
188
211
<entry><constant>T_DEC</constant></entry>
189
212
<entry>--</entry>
190
213
<entry><link
191
214
linkend="language.operators.increment">incrementing/decrementing
192
215
operators</link></entry>
193
216
</row>
194
-
<row>
217
+
<row xml:id="constant.t-declare">
195
218
<entry><constant>T_DECLARE</constant></entry>
196
219
<entry>declare</entry>
197
220
<entry><link linkend="control-structures.declare">declare</link></entry>
198
221
</row>
199
-
<row>
222
+
<row xml:id="constant.t-default">
200
223
<entry><constant>T_DEFAULT</constant></entry>
201
224
<entry>default</entry>
202
225
<entry><link linkend="control-structures.switch">switch</link></entry>
203
226
</row>
204
-
<row>
227
+
<row xml:id="constant.t-dir">
205
228
<entry><constant>T_DIR</constant></entry>
206
229
<entry>__DIR__</entry>
207
230
<entry><link linkend="language.constants.predefined">magic constants</link></entry>
208
231
</row>
209
-
<row>
232
+
<row xml:id="constant.t-div-equal">
210
233
<entry><constant>T_DIV_EQUAL</constant></entry>
211
234
<entry>/=</entry>
212
235
<entry><link linkend="language.operators.assignment">assignment
213
236
operators</link></entry>
214
237
</row>
215
-
<row>
238
+
<row xml:id="constant.t-dnumber">
216
239
<entry><constant>T_DNUMBER</constant></entry>
217
240
<entry>0.12, etc.</entry>
218
241
<entry><link linkend="language.types.float">floating point numbers</link></entry>
219
242
</row>
220
-
<row>
243
+
<row xml:id="constant.t-do">
221
244
<entry><constant>T_DO</constant></entry>
222
245
<entry>do</entry>
223
246
<entry><link linkend="control-structures.do.while">do..while</link></entry>
224
247
</row>
225
-
<row>
248
+
<row xml:id="constant.t-doc-comment">
226
249
<entry><constant>T_DOC_COMMENT</constant></entry>
227
250
<entry>/** */</entry>
228
251
<entry>
229
252
<link linkend="language.basic-syntax.comments">PHPDoc style comments</link>
230
253
</entry>
231
254
</row>
232
-
<row>
255
+
<row xml:id="constant.t-dollar-open-curly-braces">
233
256
<entry><constant>T_DOLLAR_OPEN_CURLY_BRACES</constant></entry>
234
257
<entry>${</entry>
235
258
<entry><link linkend="language.types.string.parsing.complex">complex
236
259
variable parsed syntax</link></entry>
237
260
</row>
238
-
<row>
261
+
<row xml:id="constant.t-double-arrow">
239
262
<entry><constant>T_DOUBLE_ARROW</constant></entry>
240
263
<entry>=&gt;</entry>
241
264
<entry><link linkend="language.types.array.syntax">array syntax</link></entry>
242
265
</row>
243
-
<row>
266
+
<row xml:id="constant.t-double-cast">
244
267
<entry><constant>T_DOUBLE_CAST</constant></entry>
245
268
<entry>(real), (double) or (float)</entry>
246
269
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
247
270
</row>
248
-
<row>
271
+
<row xml:id="constant.t-double-colon">
249
272
<entry><constant>T_DOUBLE_COLON</constant></entry>
250
273
<entry>::</entry>
251
274
<entry>see <constant>T_PAAMAYIM_NEKUDOTAYIM</constant> below</entry>
252
275
</row>
253
-
<row>
276
+
<row xml:id="constant.t-echo">
254
277
<entry><constant>T_ECHO</constant></entry>
255
278
<entry>echo</entry>
256
279
<entry><function>echo</function></entry>
257
280
</row>
258
-
<row>
281
+
<row xml:id="constant.t-ellipsis">
259
282
<entry><constant>T_ELLIPSIS</constant></entry>
260
283
<entry>...</entry>
261
284
<entry>
262
285
<link linkend="functions.variable-arg-list">function arguments</link>
263
286
</entry>
264
287
</row>
265
-
<row>
288
+
<row xml:id="constant.t-else">
266
289
<entry><constant>T_ELSE</constant></entry>
267
290
<entry>else</entry>
268
291
<entry><link linkend="control-structures.else">else</link></entry>
269
292
</row>
270
-
<row>
293
+
<row xml:id="constant.t-elseif">
271
294
<entry><constant>T_ELSEIF</constant></entry>
272
295
<entry>elseif</entry>
273
296
<entry><link linkend="control-structures.elseif">elseif</link></entry>
274
297
</row>
275
-
<row>
298
+
<row xml:id="constant.t-empty">
276
299
<entry><constant>T_EMPTY</constant></entry>
277
300
<entry>empty</entry>
278
301
<entry><function>empty</function></entry>
279
302
</row>
280
-
<row>
303
+
<row xml:id="constant.t-encapsed-and-whitespace">
281
304
<entry><constant>T_ENCAPSED_AND_WHITESPACE</constant></entry>
282
305
<entry>" $a"</entry>
283
306
<entry><link linkend="language.types.string.parsing">constant part of
284
307
string with variables</link></entry>
285
308
</row>
286
-
<row>
309
+
<row xml:id="constant.t-enddeclare">
287
310
<entry><constant>T_ENDDECLARE</constant></entry>
288
311
<entry>enddeclare</entry>
289
312
<entry><link linkend="control-structures.declare">declare</link>, <link
290
313
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
291
314
</row>
292
-
<row>
315
+
<row xml:id="constant.t-endfor">
293
316
<entry><constant>T_ENDFOR</constant></entry>
294
317
<entry>endfor</entry>
295
318
<entry><link linkend="control-structures.for">for</link>, <link
296
319
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
297
320
</row>
298
-
<row>
321
+
<row xml:id="constant.t-endforeach">
299
322
<entry><constant>T_ENDFOREACH</constant></entry>
300
323
<entry>endforeach</entry>
301
324
<entry>&foreach;, <link
302
325
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
303
326
</row>
304
-
<row>
327
+
<row xml:id="constant.t-endif">
305
328
<entry><constant>T_ENDIF</constant></entry>
306
329
<entry>endif</entry>
307
330
<entry><link linkend="control-structures.if">if</link>, <link
308
331
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
309
332
</row>
310
-
<row>
333
+
<row xml:id="constant.t-endswitch">
311
334
<entry><constant>T_ENDSWITCH</constant></entry>
312
335
<entry>endswitch</entry>
313
336
<entry><link linkend="control-structures.switch">switch</link>, <link
314
337
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
315
338
</row>
316
-
<row>
339
+
<row xml:id="constant.t-endwhile">
317
340
<entry><constant>T_ENDWHILE</constant></entry>
318
341
<entry>endwhile</entry>
319
342
<entry><link linkend="control-structures.while">while</link>, <link
320
343
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
321
344
</row>
322
-
<row>
345
+
<row xml:id="constant.t-enum">
346
+
<entry><constant>T_ENUM</constant></entry>
347
+
<entry>enum</entry>
348
+
<entry><link linkend="language.types.enumerations">Enumerations</link> (available as of PHP 8.1.0)</entry>
349
+
</row>
350
+
<row xml:id="constant.t-end-heredoc">
323
351
<entry><constant>T_END_HEREDOC</constant></entry>
324
352
<entry></entry>
325
353
<entry><link linkend="language.types.string.syntax.heredoc">heredoc
326
354
syntax</link></entry>
327
355
</row>
328
-
<row>
356
+
<row xml:id="constant.t-eval">
329
357
<entry><constant>T_EVAL</constant></entry>
330
358
<entry>eval()</entry>
331
359
<entry><function>eval</function></entry>
332
360
</row>
333
-
<row>
361
+
<row xml:id="constant.t-exit">
334
362
<entry><constant>T_EXIT</constant></entry>
335
363
<entry>exit or die</entry>
336
364
<entry><function>exit</function>, <function>die</function></entry>
337
365
</row>
338
-
<row>
366
+
<row xml:id="constant.t-extends">
339
367
<entry><constant>T_EXTENDS</constant></entry>
340
368
<entry>extends</entry>
341
369
<entry><link linkend="language.oop5.basic.extends">extends</link>, <link
342
370
linkend="language.oop5">classes and objects</link></entry>
343
371
</row>
344
-
<row>
372
+
<row xml:id="constant.t-file">
345
373
<entry><constant>T_FILE</constant></entry>
346
374
<entry>__FILE__</entry>
347
375
<entry><link linkend="language.constants.predefined">magic constants</link></entry>
348
376
</row>
349
-
<row>
377
+
<row xml:id="constant.t-final">
350
378
<entry><constant>T_FINAL</constant></entry>
351
379
<entry>final</entry>
352
380
<entry><xref linkend="language.oop5.final"/></entry>
353
381
</row>
354
-
<row>
382
+
<row xml:id="constant.t-finally">
355
383
<entry><constant>T_FINALLY</constant></entry>
356
384
<entry>finally</entry>
357
385
<entry><xref linkend="language.exceptions"/></entry>
358
386
</row>
359
-
<row>
387
+
<row xml:id="constant.t-fn">
360
388
<entry><constant>T_FN</constant></entry>
361
389
<entry>fn</entry>
362
390
<entry>
363
391
<link linkend="functions.arrow">arrow functions</link>
364
-
(available since PHP 7.4.0)
392
+
(available as of PHP 7.4.0)
365
393
</entry>
366
394
</row>
367
-
<row>
395
+
<row xml:id="constant.t-for">
368
396
<entry><constant>T_FOR</constant></entry>
369
397
<entry>for</entry>
370
398
<entry><link linkend="control-structures.for">for</link></entry>
371
399
</row>
372
-
<row>
400
+
<row xml:id="constant.t-foreach">
373
401
<entry><constant>T_FOREACH</constant></entry>
374
402
<entry>foreach</entry>
375
403
<entry>&foreach;</entry>
376
404
</row>
377
-
<row>
405
+
<row xml:id="constant.t-function">
378
406
<entry><constant>T_FUNCTION</constant></entry>
379
407
<entry>function</entry>
380
408
<entry><link linkend="language.functions">functions</link></entry>
381
409
</row>
382
-
<row>
410
+
<row xml:id="constant.t-func-c">
383
411
<entry><constant>T_FUNC_C</constant></entry>
384
412
<entry>__FUNCTION__</entry>
385
413
<entry>
386
414
<link linkend="language.constants.predefined">magic constants</link>
387
415
</entry>
388
416
</row>
389
-
<row>
417
+
<row xml:id="constant.t-global">
390
418
<entry><constant>T_GLOBAL</constant></entry>
391
419
<entry>global</entry>
392
420
<entry><link linkend="language.variables.scope">variable scope</link></entry>
393
421
</row>
394
-
<row>
422
+
<row xml:id="constant.t-goto">
395
423
<entry><constant>T_GOTO</constant></entry>
396
424
<entry>goto</entry>
397
425
<entry><link linkend="control-structures.goto">goto</link></entry>
398
426
</row>
399
-
<row>
427
+
<row xml:id="constant.t-halt-compiler">
400
428
<entry><constant>T_HALT_COMPILER</constant></entry>
401
429
<entry>__halt_compiler()</entry>
402
430
<entry><xref linkend="function.halt-compiler"/></entry>
403
431
</row>
404
-
<row>
432
+
<row xml:id="constant.t-if">
405
433
<entry><constant>T_IF</constant></entry>
406
434
<entry>if</entry>
407
435
<entry><link linkend="control-structures.if">if</link></entry>
408
436
</row>
409
-
<row>
437
+
<row xml:id="constant.t-implements">
410
438
<entry><constant>T_IMPLEMENTS</constant></entry>
411
439
<entry>implements</entry>
412
440
<entry><xref linkend="language.oop5.interfaces"/></entry>
413
441
</row>
414
-
<row>
442
+
<row xml:id="constant.t-inc">
415
443
<entry><constant>T_INC</constant></entry>
416
444
<entry>++</entry>
417
445
<entry><link
418
446
linkend="language.operators.increment">incrementing/decrementing
419
447
operators</link></entry>
420
448
</row>
421
-
<row>
449
+
<row xml:id="constant.t-include">
422
450
<entry><constant>T_INCLUDE</constant></entry>
423
-
<entry>include()</entry>
451
+
<entry>include</entry>
424
452
<entry><function>include</function></entry>
425
453
</row>
426
-
<row>
454
+
<row xml:id="constant.t-include-once">
427
455
<entry><constant>T_INCLUDE_ONCE</constant></entry>
428
-
<entry>include_once()</entry>
456
+
<entry>include_once</entry>
429
457
<entry><function>include_once</function></entry>
430
458
</row>
431
-
<row>
459
+
<row xml:id="constant.t-inline-html">
432
460
<entry><constant>T_INLINE_HTML</constant></entry>
433
461
<entry></entry>
434
462
<entry><link linkend="language.basic-syntax.phpmode">text outside PHP</link></entry>
435
463
</row>
436
-
<row>
464
+
<row xml:id="constant.t-instanceof">
437
465
<entry><constant>T_INSTANCEOF</constant></entry>
438
466
<entry>instanceof</entry>
439
467
<entry>
440
468
<link linkend="language.operators.type">type operators</link>
441
469
</entry>
442
470
</row>
443
-
<row>
471
+
<row xml:id="constant.t-insteadof">
444
472
<entry><constant>T_INSTEADOF</constant></entry>
445
473
<entry>insteadof</entry>
446
474
<entry><xref linkend="language.oop5.traits"/></entry>
447
475
</row>
448
-
<row>
476
+
<row xml:id="constant.t-interface">
449
477
<entry><constant>T_INTERFACE</constant></entry>
450
478
<entry>interface</entry>
451
479
<entry><xref linkend="language.oop5.interfaces"/></entry>
452
480
</row>
453
-
<row>
481
+
<row xml:id="constant.t-int-cast">
454
482
<entry><constant>T_INT_CAST</constant></entry>
455
483
<entry>(int) or (integer)</entry>
456
484
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
457
485
</row>
458
-
<row>
486
+
<row xml:id="constant.t-isset">
459
487
<entry><constant>T_ISSET</constant></entry>
460
488
<entry>isset()</entry>
461
489
<entry><function>isset</function></entry>
462
490
</row>
463
-
<row>
491
+
<row xml:id="constant.t-is-equal">
464
492
<entry><constant>T_IS_EQUAL</constant></entry>
465
493
<entry>==</entry>
466
494
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
467
495
</row>
468
-
<row>
496
+
<row xml:id="constant.t-is-greater-or-equal">
469
497
<entry><constant>T_IS_GREATER_OR_EQUAL</constant></entry>
470
498
<entry>&gt;=</entry>
471
499
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
472
500
</row>
473
-
<row>
501
+
<row xml:id="constant.t-is-identical">
474
502
<entry><constant>T_IS_IDENTICAL</constant></entry>
475
503
<entry>===</entry>
476
504
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
477
505
</row>
478
-
<row>
506
+
<row xml:id="constant.t-is-not-equal">
479
507
<entry><constant>T_IS_NOT_EQUAL</constant></entry>
480
508
<entry>!= or &lt;&gt;</entry>
481
509
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
482
510
</row>
483
-
<row>
511
+
<row xml:id="constant.t-is-not-identical">
484
512
<entry><constant>T_IS_NOT_IDENTICAL</constant></entry>
485
513
<entry>!==</entry>
486
514
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
487
515
</row>
488
-
<row>
516
+
<row xml:id="constant.t-is-smaller-or-equal">
489
517
<entry><constant>T_IS_SMALLER_OR_EQUAL</constant></entry>
490
518
<entry>&lt;=</entry>
491
519
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
492
520
</row>
493
-
<row>
521
+
<row xml:id="constant.t-line">
494
522
<entry><constant>T_LINE</constant></entry>
495
523
<entry>__LINE__</entry>
496
524
<entry><link linkend="language.constants.predefined">magic constants</link></entry>
497
525
</row>
498
-
<row>
526
+
<row xml:id="constant.t-list">
499
527
<entry><constant>T_LIST</constant></entry>
500
528
<entry>list()</entry>
501
529
<entry><function>list</function></entry>
502
530
</row>
503
-
<row>
531
+
<row xml:id="constant.t-lnumber">
504
532
<entry><constant>T_LNUMBER</constant></entry>
505
533
<entry>123, 012, 0x1ac, etc.</entry>
506
534
<entry><link linkend="language.types.integer">integers</link></entry>
507
535
</row>
508
-
<row>
536
+
<row xml:id="constant.t-logical-and">
509
537
<entry><constant>T_LOGICAL_AND</constant></entry>
510
538
<entry>and</entry>
511
539
<entry><link linkend="language.operators.logical">logical operators</link></entry>
512
540
</row>
513
-
<row>
541
+
<row xml:id="constant.t-logical-or">
514
542
<entry><constant>T_LOGICAL_OR</constant></entry>
515
543
<entry>or</entry>
516
544
<entry><link linkend="language.operators.logical">logical operators</link></entry>
517
545
</row>
518
-
<row>
546
+
<row xml:id="constant.t-logical-xor">
519
547
<entry><constant>T_LOGICAL_XOR</constant></entry>
520
548
<entry>xor</entry>
521
549
<entry><link linkend="language.operators.logical">logical operators</link></entry>
522
550
</row>
523
-
<row>
551
+
<row xml:id="constant.t-match">
552
+
<entry><constant>T_MATCH</constant></entry>
553
+
<entry>match</entry>
554
+
<entry>
555
+
&match; (available as of PHP 8.0.0)
556
+
</entry>
557
+
</row>
558
+
<row xml:id="constant.t-method-c">
524
559
<entry><constant>T_METHOD_C</constant></entry>
525
560
<entry>__METHOD__</entry>
526
561
<entry>
527
562
<link linkend="language.constants.predefined">magic constants</link>
528
563
</entry>
529
564
</row>
530
-
<row>
565
+
<row xml:id="constant.t-minus-equal">
531
566
<entry><constant>T_MINUS_EQUAL</constant></entry>
532
567
<entry>-=</entry>
533
568
<entry><link linkend="language.operators.assignment">assignment
534
569
operators</link></entry>
535
570
</row>
536
-
<row>
571
+
<row xml:id="constant.t-mod-equal">
537
572
<entry><constant>T_MOD_EQUAL</constant></entry>
538
573
<entry>%=</entry>
539
574
<entry><link linkend="language.operators.assignment">assignment
540
575
operators</link></entry>
541
576
</row>
542
-
<row>
577
+
<row xml:id="constant.t-mul-equal">
543
578
<entry><constant>T_MUL_EQUAL</constant></entry>
544
579
<entry>*=</entry>
545
580
<entry><link linkend="language.operators.assignment">assignment
546
581
operators</link></entry>
547
582
</row>
548
-
<row>
583
+
<row xml:id="constant.t-namespace">
549
584
<entry><constant>T_NAMESPACE</constant></entry>
550
585
<entry>namespace</entry>
551
586
<entry>
552
587
<link linkend="language.namespaces">namespaces</link>
553
588
</entry>
554
589
</row>
555
-
<row>
590
+
<row xml:id="constant.t-name-fully-qualified">
591
+
<entry><constant>T_NAME_FULLY_QUALIFIED</constant></entry>
592
+
<entry>\App\Namespace</entry>
593
+
<entry>
594
+
<link linkend="language.namespaces">namespaces</link> (available as of PHP 8.0.0)
595
+
</entry>
596
+
</row>
597
+
<row xml:id="constant.t-name-qualified">
598
+
<entry><constant>T_NAME_QUALIFIED</constant></entry>
599
+
<entry>App\Namespace</entry>
600
+
<entry>
601
+
<link linkend="language.namespaces">namespaces</link> (available as of PHP 8.0.0)
602
+
</entry>
603
+
</row>
604
+
<row xml:id="constant.t-name-relative">
605
+
<entry><constant>T_NAME_RELATIVE</constant></entry>
606
+
<entry>namespace\Namespace</entry>
607
+
<entry>
608
+
<link linkend="language.namespaces">namespaces</link> (available as of PHP 8.0.0)
609
+
</entry>
610
+
</row>
611
+
<row xml:id="constant.t-new">
556
612
<entry><constant>T_NEW</constant></entry>
557
613
<entry>new</entry>
558
614
<entry><link linkend="language.oop5">classes and objects</link></entry>
559
615
</row>
560
-
<row>
616
+
<row xml:id="constant.t-ns-c">
561
617
<entry><constant>T_NS_C</constant></entry>
562
618
<entry>__NAMESPACE__</entry>
563
619
<entry>
564
620
<link linkend="language.namespaces">namespaces</link>
565
621
</entry>
566
622
</row>
567
-
<row>
623
+
<row xml:id="constant.t-ns-separator">
568
624
<entry><constant>T_NS_SEPARATOR</constant></entry>
569
625
<entry>\</entry>
570
626
<entry>
571
627
<link linkend="language.namespaces">namespaces</link>
572
628
</entry>
573
629
</row>
574
-
<row>
630
+
<row xml:id="constant.t-num-string">
575
631
<entry><constant>T_NUM_STRING</constant></entry>
576
632
<entry>"$a[0]"</entry>
577
633
<entry><link linkend="language.types.string.parsing">numeric array index
578
634
inside string</link></entry>
579
635
</row>
580
-
<row>
636
+
<row xml:id="constant.t-object-cast">
581
637
<entry><constant>T_OBJECT_CAST</constant></entry>
582
638
<entry>(object)</entry>
583
639
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
584
640
</row>
585
-
<row>
641
+
<row xml:id="constant.t-object-operator">
586
642
<entry><constant>T_OBJECT_OPERATOR</constant></entry>
587
643
<entry>-&gt;</entry>
588
644
<entry><link linkend="language.oop5">classes and objects</link></entry>
589
645
</row>
590
-
<row>
646
+
<row xml:id="constant.t-nullsafe-object-operator">
647
+
<entry><constant>T_NULLSAFE_OBJECT_OPERATOR</constant></entry>
648
+
<entry>?-&gt;</entry>
649
+
<entry><link linkend="language.oop5">classes and objects</link></entry>
650
+
</row>
651
+
<row xml:id="constant.t-open-tag">
591
652
<entry><constant>T_OPEN_TAG</constant></entry>
592
653
<entry>&lt;?php, &lt;? or &lt;%</entry>
593
654
<entry><link linkend="language.basic-syntax.phpmode">escaping
594
655
from HTML</link></entry>
595
656
</row>
596
-
<row>
657
+
<row xml:id="constant.t-open-tag-with-echo">
597
658
<entry><constant>T_OPEN_TAG_WITH_ECHO</constant></entry>
598
659
<entry>&lt;?= or &lt;%=</entry>
599
660
<entry><link linkend="language.basic-syntax.phpmode">escaping
600
661
from HTML</link></entry>
601
662
</row>
602
-
<row>
663
+
<row xml:id="constant.t-or-equal">
603
664
<entry><constant>T_OR_EQUAL</constant></entry>
604
665
<entry>|=</entry>
605
666
<entry><link linkend="language.operators.assignment">assignment
606
667
operators</link></entry>
607
668
</row>
608
-
<row>
669
+
<row xml:id="constant.t-paamayim-nekudotayim">
609
670
<entry><constant>T_PAAMAYIM_NEKUDOTAYIM</constant></entry>
610
671
<entry>::</entry>
611
672
<entry><link linkend="language.oop5.paamayim-nekudotayim">::</link>. Also defined as
612
673
<constant>T_DOUBLE_COLON</constant>.</entry>
613
674
</row>
614
-
<row>
675
+
<row xml:id="constant.t-plus-equal">
615
676
<entry><constant>T_PLUS_EQUAL</constant></entry>
616
677
<entry>+=</entry>
617
678
<entry><link linkend="language.operators.assignment">assignment
618
679
operators</link></entry>
619
680
</row>
620
-
<row>
681
+
<row xml:id="constant.t-pow">
621
682
<entry><constant>T_POW</constant></entry>
622
683
<entry>**</entry>
623
684
<entry>
624
685
<link linkend="language.operators.arithmetic">arithmetic operators</link>
625
686
</entry>
626
687
</row>
627
-
<row>
688
+
<row xml:id="constant.t-pow-equal">
628
689
<entry><constant>T_POW_EQUAL</constant></entry>
629
690
<entry>**=</entry>
630
691
<entry>
631
692
<link linkend="language.operators.assignment">assignment operators</link>
632
693
</entry>
633
694
</row>
634
-
<row>
695
+
<row xml:id="constant.t-print">
635
696
<entry><constant>T_PRINT</constant></entry>
636
-
<entry>print()</entry>
697
+
<entry>print</entry>
637
698
<entry><function>print</function></entry>
638
699
</row>
639
-
<row>
700
+
<row xml:id="constant.t-private">
640
701
<entry><constant>T_PRIVATE</constant></entry>
641
702
<entry>private</entry>
642
703
<entry>
643
704
<link linkend="language.oop5">classes and objects</link>
644
705
</entry>
645
706
</row>
646
-
<row>
707
+
<row xml:id="constant.t-protected">
647
708
<entry><constant>T_PROTECTED</constant></entry>
648
709
<entry>protected</entry>
649
710
<entry>
650
711
<link linkend="language.oop5">classes and objects</link>
651
712
</entry>
652
713
</row>
653
-
<row>
714
+
<row xml:id="constant.t-public">
654
715
<entry><constant>T_PUBLIC</constant></entry>
655
716
<entry>public</entry>
656
717
<entry>
657
718
<link linkend="language.oop5">classes and objects</link>
658
719
</entry>
659
720
</row>
660
-
<row>
721
+
<row xml:id="constant.t-readonly">
722
+
<entry><constant>T_READONLY</constant></entry>
723
+
<entry>readonly</entry>
724
+
<entry>
725
+
<link linkend="language.oop5">classes and objects</link> (available as of PHP 8.1.0)
726
+
</entry>
727
+
</row>
728
+
<row xml:id="constant.t-require">
661
729
<entry><constant>T_REQUIRE</constant></entry>
662
-
<entry>require()</entry>
730
+
<entry>require</entry>
663
731
<entry><function>require</function></entry>
664
732
</row>
665
-
<row>
733
+
<row xml:id="constant.t-require-once">
666
734
<entry><constant>T_REQUIRE_ONCE</constant></entry>
667
-
<entry>require_once()</entry>
735
+
<entry>require_once</entry>
668
736
<entry><function>require_once</function></entry>
669
737
</row>
670
-
<row>
738
+
<row xml:id="constant.t-return">
671
739
<entry><constant>T_RETURN</constant></entry>
672
740
<entry>return</entry>
673
741
<entry><link linkend="functions.returning-values">returning values</link></entry>
674
742
</row>
675
-
<row>
743
+
<row xml:id="constant.t-sl">
676
744
<entry><constant>T_SL</constant></entry>
677
745
<entry>&lt;&lt;</entry>
678
746
<entry><link linkend="language.operators.bitwise">bitwise
679
747
operators</link></entry>
680
748
</row>
681
-
<row>
749
+
<row xml:id="constant.t-sl-equal">
682
750
<entry><constant>T_SL_EQUAL</constant></entry>
683
751
<entry>&lt;&lt;=</entry>
684
752
<entry><link linkend="language.operators.assignment">assignment
685
753
operators</link></entry>
686
754
</row>
687
-
<row>
755
+
<row xml:id="constant.t-spaceship">
688
756
<entry><constant>T_SPACESHIP</constant></entry>
689
757
<entry>&lt;=&gt;</entry>
690
758
<entry>
691
759
<link linkend="language.operators.comparison">comparison operators</link>
692
760
</entry>
693
761
</row>
694
-
<row>
762
+
<row xml:id="constant.t-sr">
695
763
<entry><constant>T_SR</constant></entry>
696
764
<entry>&gt;&gt;</entry>
697
765
<entry><link linkend="language.operators.bitwise">bitwise
698
766
operators</link></entry>
699
767
</row>
700
-
<row>
768
+
<row xml:id="constant.t-sr-equal">
701
769
<entry><constant>T_SR_EQUAL</constant></entry>
702
770
<entry>&gt;&gt;=</entry>
703
771
<entry><link linkend="language.operators.assignment">assignment
704
772
operators</link></entry>
705
773
</row>
706
-
<row>
774
+
<row xml:id="constant.t-start-heredoc">
707
775
<entry><constant>T_START_HEREDOC</constant></entry>
708
776
<entry>&lt;&lt;&lt;</entry>
709
777
<entry><link linkend="language.types.string.syntax.heredoc">heredoc
710
778
syntax</link></entry>
711
779
</row>
712
-
<row>
780
+
<row xml:id="constant.t-static">
713
781
<entry><constant>T_STATIC</constant></entry>
714
782
<entry>static</entry>
715
783
<entry><link linkend="language.variables.scope">variable scope</link></entry>
716
784
</row>
717
-
<row>
785
+
<row xml:id="constant.t-string">
718
786
<entry><constant>T_STRING</constant></entry>
719
787
<entry>parent, self, etc.</entry>
720
788
<entry>
...
...
@@ -723,90 +791,90 @@
723
791
See also <constant>T_CONSTANT_ENCAPSED_STRING</constant>.
724
792
</entry>
725
793
</row>
726
-
<row>
794
+
<row xml:id="constant.t-string-cast">
727
795
<entry><constant>T_STRING_CAST</constant></entry>
728
796
<entry>(string)</entry>
729
797
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
730
798
</row>
731
-
<row>
799
+
<row xml:id="constant.t-string-varname">
732
800
<entry><constant>T_STRING_VARNAME</constant></entry>
733
801
<entry>"${a</entry>
734
802
<entry><link linkend="language.types.string.parsing.complex">complex
735
803
variable parsed syntax</link></entry>
736
804
</row>
737
-
<row>
805
+
<row xml:id="constant.t-switch">
738
806
<entry><constant>T_SWITCH</constant></entry>
739
807
<entry>switch</entry>
740
808
<entry><link linkend="control-structures.switch">switch</link></entry>
741
809
</row>
742
-
<row>
810
+
<row xml:id="constant.t-throw">
743
811
<entry><constant>T_THROW</constant></entry>
744
812
<entry>throw</entry>
745
813
<entry><xref linkend="language.exceptions"/></entry>
746
814
</row>
747
-
<row>
815
+
<row xml:id="constant.t-trait">
748
816
<entry><constant>T_TRAIT</constant></entry>
749
817
<entry>trait</entry>
750
818
<entry><xref linkend="language.oop5.traits"/></entry>
751
819
</row>
752
-
<row>
820
+
<row xml:id="constant.t-trait-c">
753
821
<entry><constant>T_TRAIT_C</constant></entry>
754
822
<entry>__TRAIT__</entry>
755
-
<entry><link linkend="constant.trait">__TRAIT__</link></entry>
823
+
<entry><constant>__TRAIT__</constant></entry>
756
824
</row>
757
-
<row>
825
+
<row xml:id="constant.t-try">
758
826
<entry><constant>T_TRY</constant></entry>
759
827
<entry>try</entry>
760
828
<entry><xref linkend="language.exceptions"/></entry>
761
829
</row>
762
-
<row>
830
+
<row xml:id="constant.t-unset">
763
831
<entry><constant>T_UNSET</constant></entry>
764
832
<entry>unset()</entry>
765
833
<entry><function>unset</function></entry>
766
834
</row>
767
-
<row>
835
+
<row xml:id="constant.t-unset-cast">
768
836
<entry><constant>T_UNSET_CAST</constant></entry>
769
837
<entry>(unset)</entry>
770
838
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
771
839
</row>
772
-
<row>
840
+
<row xml:id="constant.t-use">
773
841
<entry><constant>T_USE</constant></entry>
774
842
<entry>use</entry>
775
843
<entry><link linkend="language.namespaces">namespaces</link></entry>
776
844
</row>
777
-
<row>
845
+
<row xml:id="constant.t-var">
778
846
<entry><constant>T_VAR</constant></entry>
779
847
<entry>var</entry>
780
848
<entry><link linkend="language.oop5">classes and objects</link></entry>
781
849
</row>
782
-
<row>
850
+
<row xml:id="constant.t-variable">
783
851
<entry><constant>T_VARIABLE</constant></entry>
784
852
<entry>$foo</entry>
785
853
<entry><link linkend="language.variables">variables</link></entry>
786
854
</row>
787
-
<row>
855
+
<row xml:id="constant.t-while">
788
856
<entry><constant>T_WHILE</constant></entry>
789
857
<entry>while</entry>
790
858
<entry><link linkend="control-structures.while">while</link>, <link
791
859
linkend="control-structures.do.while">do..while</link></entry>
792
860
</row>
793
-
<row>
861
+
<row xml:id="constant.t-whitespace">
794
862
<entry><constant>T_WHITESPACE</constant></entry>
795
863
<entry>\t \r\n</entry>
796
864
<entry></entry>
797
865
</row>
798
-
<row>
866
+
<row xml:id="constant.t-xor-equal">
799
867
<entry><constant>T_XOR_EQUAL</constant></entry>
800
868
<entry>^=</entry>
801
869
<entry><link linkend="language.operators.assignment">assignment
802
870
operators</link></entry>
803
871
</row>
804
-
<row>
872
+
<row xml:id="constant.t-yield">
805
873
<entry><constant>T_YIELD</constant></entry>
806
874
<entry>yield</entry>
807
875
<entry><link linkend="control-structures.yield">generators</link></entry>
808
876
</row>
809
-
<row>
877
+
<row xml:id="constant.t-yield-from">
810
878
<entry><constant>T_YIELD_FROM</constant></entry>
811
879
<entry>yield from</entry>
812
880
<entry><link linkend="control-structures.yield.from">generators</link></entry>
813
881