diff --git a/language/types.xml b/language/types.xml index 24e397f309d7..14483ea5ce0a 100644 --- a/language/types.xml +++ b/language/types.xml @@ -131,7 +131,7 @@ int(16) &language.types.void; &language.types.never; &language.types.relative-class-types; - &language.types.unit; + &language.types.singleton; &language.types.iterable; &language.types.declarations; &language.types.type-juggling; diff --git a/language/types/declarations.xml b/language/types/declarations.xml index fd3b9d589a43..4d63b80c95f1 100644 --- a/language/types/declarations.xml +++ b/language/types/declarations.xml @@ -271,7 +271,7 @@ Stack trace: 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.