appendices/reserved.xml
010542d1dcb9b1d5cd397a77ed580e50de25aca7
...
...
@@ -17,7 +17,7 @@
17
17
These words have special meaning in PHP. Some of them represent things
18
18
which look like functions, some look like constants, and so on - but
19
19
they're not, really: they are language constructs.
20
-
The following words cannot be used as constants, class names, function or method names.
20
+
The following words cannot be used as constants, class names, or function names.
21
21
They are, however, allowed as property, constant, and
22
22
method names of classes, interfaces and traits, except that
23
23
<literal>class</literal> may not be used as constant name.
...
...
@@ -188,7 +188,7 @@
188
188
<function>list</function>
189
189
</entry>
190
190
<entry>
191
-
<link linkend="control-structures.match">match</link> (as of PHP 8.0)
191
+
&match; (as of PHP 8.0)
192
192
</entry>
193
193
<entry>
194
194
<link linkend="language.namespaces">namespace</link>
...
...
@@ -216,6 +216,9 @@
216
216
</row>
217
217
<row>
218
218
<entry>
219
+
<link linkend="language.oop5.properties.readonly-properties">readonly</link> (as of PHP 8.1.0) *
220
+
</entry>
221
+
<entry>
219
222
<function>require</function>
220
223
</entry>
221
224
<entry>
...
...
@@ -227,11 +230,11 @@
227
230
<entry>
228
231
<link linkend="language.variables.scope">static</link>
229
232
</entry>
233
+
</row>
234
+
<row>
230
235
<entry>
231
236
<link linkend="control-structures.switch">switch</link>
232
237
</entry>
233
-
</row>
234
-
<row>
235
238
<entry>
236
239
<link linkend="language.exceptions">throw</link>
237
240
</entry>
...
...
@@ -244,11 +247,11 @@
244
247
<entry>
245
248
<function>unset</function>
246
249
</entry>
250
+
</row>
251
+
<row>
247
252
<entry>
248
253
<link linkend="language.namespaces">use</link>
249
254
</entry>
250
-
</row>
251
-
<row>
252
255
<entry>
253
256
<link linkend="language.oop5.properties">var</link>
254
257
</entry>
...
...
@@ -261,14 +264,24 @@
261
264
<entry>
262
265
<link linkend="language.generators">yield</link>
263
266
</entry>
267
+
</row>
268
+
<row>
264
269
<entry>
265
270
<link linkend="control-structures.yield.from">yield from</link>
266
271
</entry>
272
+
<entry></entry>
273
+
<entry></entry>
274
+
<entry></entry>
275
+
<entry></entry>
267
276
</row>
268
277
</tbody>
269
278
</tgroup>
270
279
</table>
271
280

281
+
<simpara>
282
+
* <literal>readonly</literal> may be used as function name.
283
+
</simpara>
284
+

272
285
<table>
273
286
<title>Compile-time constants</title>
274
287
<tgroup cols="5">
...
...
@@ -342,8 +355,9 @@
342
355
<term><classname>stdClass</classname></term>
343
356
<listitem>
344
357
<simpara>
345
-
Created by <link linkend="language.types.object.casting">typecasting
346
-
to object</link>.
358
+
A generic empty class created as a result of
359
+
<link linkend="language.types.object.casting">typecasting
360
+
to object</link> or various standard functions.
347
361
</simpara>
348
362
</listitem>
349
363
</varlistentry>
...
...
@@ -493,13 +507,13 @@
493
507
<sect1 xml:id="reserved.other-reserved-words">
494
508
<title>List of other reserved words</title>
495
509
<simpara>
496
-
The following words cannot be used to name a class, interface or trait, and
497
-
they are also prohibited from being used in namespaces.
510
+
The following words cannot be used to name a class, interface or trait.
511
+
Prior to PHP 8.0, they are also prohibited from being used in namespaces.
498
512
</simpara>
499
513
<para>
500
514
<table>
501
515
<title>Reserved words</title>
502
-
<tgroup cols="5">
516
+
<tgroup cols="4">
503
517
<tbody>
504
518
<row>
505
519
<entry>
...
...
@@ -536,6 +550,12 @@
536
550
<entry>
537
551
object (as of PHP 7.2)
538
552
</entry>
553
+
<entry>
554
+
mixed (as of PHP 8.0)
555
+
</entry>
556
+
<entry>
557
+
never (as of PHP 8.1)
558
+
</entry>
539
559
</row>
540
560
</tbody>
541
561
</tgroup>
...
...
@@ -543,21 +563,21 @@
543
563
</para>
544
564
<para>
545
565
The following list of words have had soft reservations placed on them.
546
-
Whilst they may still be used as class, interface, and trait names (as well
547
-
as in namespaces), usage of them is highly discouraged since they may be
566
+
Whilst they may still be used as class, interface, and trait names
567
+
usage of them is highly discouraged since they may be
548
568
used in future versions of PHP.
549
569
</para>
550
570
<para>
551
571
<table>
552
572
<title>Soft reserved words</title>
553
-
<tgroup cols="5">
573
+
<tgroup cols="4">
554
574
<tbody>
555
575
<row>
556
576
<entry>
557
-
resource
577
+
enum
558
578
</entry>
559
579
<entry>
560
-
mixed
580
+
resource
561
581
</entry>
562
582
<entry>
563
583
numeric
564
584