Union types
- It is not possible to combine the two value types false
+ It is not possible to combine the two singleton types false
and true together in a union type.
Use bool instead.
diff --git a/language/types/value.xml b/language/types/singleton.xml
similarity index 65%
rename from language/types/value.xml
rename to language/types/singleton.xml
index 643bbe12525d..97d7cb5e35b9 100644
--- a/language/types/value.xml
+++ b/language/types/singleton.xml
@@ -1,24 +1,25 @@
-
- Value types
+
+ Singleton types
- Value types are those which not only check the type of a value but also
- the value itself. PHP has support for two value types:
- false as of PHP 8.0.0, and true
+ Singleton types are those which allow only one value.
+ PHP has support for two singleton types:
+ false as of PHP 8.0.0 and true
as of PHP 8.2.0.
- Prior to PHP 8.2.0 the false type could only be used as part of a
+ Prior to PHP 8.2.0 the false type
+ could only be used as part of a
union type.
- It is not possible to define custom value types. Consider using an
+ It is not possible to define custom singleton types. Consider using an
enumerations instead.
diff --git a/language/types/type-system.xml b/language/types/type-system.xml
index e71f3be231c0..2bac2d22809a 100644
--- a/language/types/type-system.xml
+++ b/language/types/type-system.xml
@@ -27,9 +27,6 @@
Built-in types
-
- null type
-
Scalar types:
@@ -70,18 +67,28 @@
self, parent, and static
-
-
-
-
- Value types
-
-
- false
+
+ Singleton types
+
+
+
+ false
+
+
+ true
+
+
- true
+
+ Unit types
+
+
+
+ null
+
+