Union types
- It is not possible to combine the two unit 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/type-system.xml b/language/types/type-system.xml
index fd7ad8b6eca7..2bac2d22809a 100644
--- a/language/types/type-system.xml
+++ b/language/types/type-system.xml
@@ -69,7 +69,7 @@
- Unit types
+ Singleton types
@@ -78,6 +78,13 @@
true
+
+
+
+
+ Unit types
+
+ null
diff --git a/language/types/unit.xml b/language/types/unit.xml
index c6a067d60882..97d7cb5e35b9 100644
--- a/language/types/unit.xml
+++ b/language/types/unit.xml
@@ -1,17 +1,17 @@
-
- Unit types
+
+ Singleton types
- Unit types are those which allow only one value.
- PHP has support for three unit types:
- false as of PHP 8.0.0, true
- as of PHP 8.2.0, and null.
+ 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 and null type
+ Prior to PHP 8.2.0 the false type
could only be used as part of a
union type.
@@ -19,7 +19,7 @@
- It is not possible to define custom unit types. Consider using an
+ It is not possible to define custom singleton types. Consider using an
enumerations instead.