File tree Expand file tree Collapse file tree 4 files changed +29
-21
lines changed Expand file tree Collapse file tree 4 files changed +29
-21
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ int(16)
131
131
&language.types.void;
132
132
&language.types.never;
133
133
&language.types.relative-class-types;
134
- &language.types.value ;
134
+ &language.types.singleton ;
135
135
&language.types.iterable;
136
136
&language.types.declarations;
137
137
&language.types.type-juggling;
Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ Stack trace:
271
271
<title >Union types</title >
272
272
<warning >
273
273
<simpara >
274
- It is not possible to combine the two value types <type >false</type >
274
+ It is not possible to combine the two singleton types <type >false</type >
275
275
and <type >true</type > together in a union type.
276
276
Use <type >bool</type > instead.
277
277
</simpara >
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
- <sect1 xml : id =" language.types.value " >
3
- <title >Value types</title >
2
+ <sect1 xml : id =" language.types.singleton " >
3
+ <title >Singleton types</title >
4
4
5
5
<para >
6
- Value types are those which not only check the type of a value but also
7
- the value itself. PHP has support for two value types:
8
- <type >false</type > as of PHP 8.0.0, and <type >true</type >
6
+ Singleton types are those which allow only one value.
7
+ PHP has support for two singleton types:
8
+ <type >false</type > as of PHP 8.0.0 and <type >true</type >
9
9
as of PHP 8.2.0.
10
10
</para >
11
11
12
12
<warning >
13
13
<simpara >
14
- Prior to PHP 8.2.0 the <type >false</type > type could only be used as part of a
14
+ Prior to PHP 8.2.0 the <type >false</type > type
15
+ could only be used as part of a
15
16
<link linkend =" language.types.type-system.composite.union" >union type</link >.
16
17
</simpara >
17
18
</warning >
18
19
19
20
<note >
20
21
<simpara >
21
- It is not possible to define custom value types. Consider using an
22
+ It is not possible to define custom singleton types. Consider using an
22
23
<link linkend =" language.types.enumerations" >enumerations</link > instead.
23
24
</simpara >
24
25
</note >
Original file line number Diff line number Diff line change 27
27
<listitem >
28
28
<simpara >Built-in types</simpara >
29
29
<itemizedlist >
30
- <listitem >
31
- <simpara ><type >null</type > type</simpara >
32
- </listitem >
33
30
<listitem >
34
31
<simpara >
35
32
Scalar types:
70
67
<type >self</type >, <type >parent</type >, and <type >static</type >
71
68
</simpara >
72
69
</listitem >
73
- </itemizedlist >
74
- </listitem >
75
- <listitem >
76
- <simpara >
77
- <link linkend =" language.types.value" >Value types</link >
78
- </simpara >
79
- <itemizedlist >
80
70
<listitem >
81
- <simpara ><type >false</type ></simpara >
71
+ <simpara >
72
+ <link linkend =" language.types.singleton" >Singleton types</link >
73
+ </simpara >
74
+ <itemizedlist >
75
+ <listitem >
76
+ <simpara ><type >false</type ></simpara >
77
+ </listitem >
78
+ <listitem >
79
+ <simpara ><type >true</type ></simpara >
80
+ </listitem >
81
+ </itemizedlist >
82
82
</listitem >
83
83
<listitem >
84
- <simpara ><type >true</type ></simpara >
84
+ <simpara >
85
+ Unit types
86
+ </simpara >
87
+ <itemizedlist >
88
+ <listitem >
89
+ <simpara ><type >null</type ></simpara >
90
+ </listitem >
91
+ </itemizedlist >
85
92
</listitem >
86
93
</itemizedlist >
87
94
</listitem >
You can’t perform that action at this time.
0 commit comments