From 0d3fad330c9f477b7b783cdac31e50523945791c Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Date: Tue, 30 Jun 2026 12:01:52 +0200 Subject: [PATCH 1/2] Use &true;/&false;/&null; entities for boolean/null constants Replace true/false/null with the standard entities where they denote the PHP boolean/null constant. Quoted strings, JSON/INI literals, SQL NULL and type notations are intentionally left untouched. --- language/control-structures/include.xml | 2 +- language/enumerations.xml | 2 +- language/oop5/overloading.xml | 2 +- language/predefined/weakreference.xml | 2 +- language/types/array.xml | 2 +- language/types/declarations.xml | 2 +- reference/datetime/dateinterval/createfromdatestring.xml | 2 +- reference/datetime/datetime/modify.xml | 2 +- reference/datetime/datetimeimmutable/modify.xml | 2 +- reference/filter/constants.xml | 4 ++-- reference/info/functions/ini-get.xml | 2 +- reference/intl/ini.xml | 2 +- reference/mbstring/functions/mb-strcut.xml | 2 +- reference/mbstring/functions/mb-substr.xml | 2 +- reference/pdo/constants.fetch-modes.xml | 2 +- reference/pdo/pdo/getattribute.xml | 2 +- reference/reflection/reflectionenum/getbackingtype.xml | 4 ++-- reference/swoole/swoole/coroutine/lock/lock.xml | 4 ++-- reference/swoole/swoole/coroutine/lock/trylock.xml | 4 ++-- reference/swoole/swoole/coroutine/lock/unlock.xml | 4 ++-- reference/win32service/rightinfo/get-full-username.xml | 2 +- 21 files changed, 26 insertions(+), 26 deletions(-) diff --git a/language/control-structures/include.xml b/language/control-structures/include.xml index 33a91ebc79dc..d2de8cb4450d 100644 --- a/language/control-structures/include.xml +++ b/language/control-structures/include.xml @@ -181,7 +181,7 @@ include 'http://www.example.com/file.php?foo=1&bar=2'; Handling Returns: include returns - FALSE on failure and raises a warning. Successful + &false; on failure and raises a warning. Successful includes, unless overridden by the included file, return 1. It is possible to execute a return statement inside an included file in order to terminate processing in diff --git a/language/enumerations.xml b/language/enumerations.xml index 8a346156ccce..ac543de3ab87 100644 --- a/language/enumerations.xml +++ b/language/enumerations.xml @@ -294,7 +294,7 @@ $ref = &$suit->value; tryFrom(int|string): ?self will take a scalar and return the - corresponding Enum Case. If one is not found, it will return null. + corresponding Enum Case. If one is not found, it will return &null;. This is mainly useful in cases where the input scalar is untrusted and the caller wants to implement their own error handling or default-value logic. diff --git a/language/oop5/overloading.xml b/language/oop5/overloading.xml index 40fb5cb44a87..dd2ec3cbba04 100644 --- a/language/oop5/overloading.xml +++ b/language/oop5/overloading.xml @@ -116,7 +116,7 @@ PHP will not call an overloaded method from within the same overloaded method. That means, for example, writing return $this->foo inside of - __get() will return null + __get() will return &null; and raise an E_WARNING if there is no foo property defined, rather than calling __get() a second time. However, overload methods may invoke other overload methods implicitly (such as diff --git a/language/predefined/weakreference.xml b/language/predefined/weakreference.xml index f8c040eb8156..7cd4ad494b78 100644 --- a/language/predefined/weakreference.xml +++ b/language/predefined/weakreference.xml @@ -91,7 +91,7 @@ NULL 8.4.0 The output of WeakReference::__debugInfo now includes - the referenced object, or NULL if the reference is no longer + the referenced object, or &null; if the reference is no longer valid. diff --git a/language/types/array.xml b/language/types/array.xml index 5ecc93e8d368..a45389522570 100644 --- a/language/types/array.xml +++ b/language/types/array.xml @@ -115,7 +115,7 @@ var_dump($array1, $array2); Null will be cast to the empty string, i.e. the key - null will actually be stored under "". + &null; will actually be stored under "". diff --git a/language/types/declarations.xml b/language/types/declarations.xml index 7946793f928f..7f5079f55884 100644 --- a/language/types/declarations.xml +++ b/language/types/declarations.xml @@ -306,7 +306,7 @@ Stack trace: It is also possible to achieve nullable arguments by making - null the default value. + &null; the default value. This is not recommended as if the default value is changed in a child class a type compatibility violation will be raised as the null type will need to be added to the type declaration. diff --git a/reference/datetime/dateinterval/createfromdatestring.xml b/reference/datetime/dateinterval/createfromdatestring.xml index 6e06f46c92e2..886cac0d345b 100644 --- a/reference/datetime/dateinterval/createfromdatestring.xml +++ b/reference/datetime/dateinterval/createfromdatestring.xml @@ -89,7 +89,7 @@ DateInterval::createFromDateString now throws DateMalformedIntervalStringException if an - invalid string is passed. Previously, it returned false, + invalid string is passed. Previously, it returned &false;, and a warning was emitted. date_interval_create_from_date_string has not been changed. diff --git a/reference/datetime/datetime/modify.xml b/reference/datetime/datetime/modify.xml index 73352a56c8c5..f8e95d50ce15 100644 --- a/reference/datetime/datetime/modify.xml +++ b/reference/datetime/datetime/modify.xml @@ -78,7 +78,7 @@ DateTime::modify now throws DateMalformedStringException if an - invalid string is passed. Previously, it returned false, + invalid string is passed. Previously, it returned &false;, and a warning was emitted. date_modify has not been changed. diff --git a/reference/datetime/datetimeimmutable/modify.xml b/reference/datetime/datetimeimmutable/modify.xml index 19786b6b3a2d..961d86be6ed3 100644 --- a/reference/datetime/datetimeimmutable/modify.xml +++ b/reference/datetime/datetimeimmutable/modify.xml @@ -71,7 +71,7 @@ DateTimeImmutable::modify now throws DateMalformedStringException if an - invalid string is passed. Previously, it returned false, + invalid string is passed. Previously, it returned &false;, and a warning was emitted. diff --git a/reference/filter/constants.xml b/reference/filter/constants.xml index 9ae0a4d0c1d5..88bd5bb64281 100644 --- a/reference/filter/constants.xml +++ b/reference/filter/constants.xml @@ -285,14 +285,14 @@ Returns &true; for "1", 1 including binary, octal and hexadecimal notations, 1.0 including scientific notation, - "true", true, + "true", &true;, "on", and "yes". Returns &false; for "0", 0 including binary, octal and hexadecimal notations, 0.0 including scientific notation, - "false", false, + "false", &false;, "off", "no", and "". diff --git a/reference/info/functions/ini-get.xml b/reference/info/functions/ini-get.xml index 5f8163c87946..44f5f0b6e5d4 100644 --- a/reference/info/functions/ini-get.xml +++ b/reference/info/functions/ini-get.xml @@ -37,7 +37,7 @@ &reftitle.returnvalues; Returns the value of the configuration option as a string on success, or an - empty string for null values. Returns &false; if the + empty string for &null; values. Returns &false; if the configuration option doesn't exist. diff --git a/reference/intl/ini.xml b/reference/intl/ini.xml index 0c337acde25c..b30622da9517 100644 --- a/reference/intl/ini.xml +++ b/reference/intl/ini.xml @@ -54,7 +54,7 @@ The locale that will be used in intl functions when none is specified (either by omitting the corresponding argument or by passing - NULL). These are ICU locales, not system locales. + &null;). These are ICU locales, not system locales. The built-in ICU locales and their data can be explored at . diff --git a/reference/mbstring/functions/mb-strcut.xml b/reference/mbstring/functions/mb-strcut.xml index 9bcee3884b35..76ca92a0aa72 100644 --- a/reference/mbstring/functions/mb-strcut.xml +++ b/reference/mbstring/functions/mb-strcut.xml @@ -63,7 +63,7 @@ length - Length in bytes. If omitted or NULL + Length in bytes. If omitted or &null; is passed, extract all bytes to the end of the string. diff --git a/reference/mbstring/functions/mb-substr.xml b/reference/mbstring/functions/mb-substr.xml index 47e63dea6a31..0f6ee7e4d33b 100644 --- a/reference/mbstring/functions/mb-substr.xml +++ b/reference/mbstring/functions/mb-substr.xml @@ -61,7 +61,7 @@ Maximum number of characters to use from string. If - omitted or NULL is passed, extract all characters to + omitted or &null; is passed, extract all characters to the end of the string. diff --git a/reference/pdo/constants.fetch-modes.xml b/reference/pdo/constants.fetch-modes.xml index 9ea4dbc81c44..c72182149b29 100644 --- a/reference/pdo/constants.fetch-modes.xml +++ b/reference/pdo/constants.fetch-modes.xml @@ -1120,7 +1120,7 @@ object(TestEntity)#3 (4) { - PDORow will return NULL without + PDORow will return &null; without any error or warning when accessing properties or keys that are not defined. This can make errors such as typos or queries not returning expected data harder to spot and debug. diff --git a/reference/pdo/pdo/getattribute.xml b/reference/pdo/pdo/getattribute.xml index 8e508487b43b..8264b76961cb 100644 --- a/reference/pdo/pdo/getattribute.xml +++ b/reference/pdo/pdo/getattribute.xml @@ -67,7 +67,7 @@ &reftitle.returnvalues; A successful call returns the value of the requested PDO attribute. - An unsuccessful call returns null. + An unsuccessful call returns &null;. diff --git a/reference/reflection/reflectionenum/getbackingtype.xml b/reference/reflection/reflectionenum/getbackingtype.xml index e637dc9781fe..d922e280c9cf 100644 --- a/reference/reflection/reflectionenum/getbackingtype.xml +++ b/reference/reflection/reflectionenum/getbackingtype.xml @@ -14,7 +14,7 @@ If the enumeration is a Backed Enum, this method will return an instance of ReflectionType for the backing type of the Enum. - If it is not a Backed Enum, it will return null. + If it is not a Backed Enum, it will return &null;. @@ -27,7 +27,7 @@ &reftitle.returnvalues; - An instance of ReflectionNamedType, or null + An instance of ReflectionNamedType, or &null; if the Enum has no backing type. diff --git a/reference/swoole/swoole/coroutine/lock/lock.xml b/reference/swoole/swoole/coroutine/lock/lock.xml index 41421d671529..a231d9c05e95 100644 --- a/reference/swoole/swoole/coroutine/lock/lock.xml +++ b/reference/swoole/swoole/coroutine/lock/lock.xml @@ -29,8 +29,8 @@ &reftitle.returnvalues; - Returns true if the lock was acquired successfully, - false otherwise. + Returns &true; if the lock was acquired successfully, + &false; otherwise. diff --git a/reference/swoole/swoole/coroutine/lock/trylock.xml b/reference/swoole/swoole/coroutine/lock/trylock.xml index 19a75d354e8a..6c7e656cc534 100644 --- a/reference/swoole/swoole/coroutine/lock/trylock.xml +++ b/reference/swoole/swoole/coroutine/lock/trylock.xml @@ -29,8 +29,8 @@ &reftitle.returnvalues; - Returns true if the lock was acquired successfully, - false if the lock is not available. + Returns &true; if the lock was acquired successfully, + &false; if the lock is not available. diff --git a/reference/swoole/swoole/coroutine/lock/unlock.xml b/reference/swoole/swoole/coroutine/lock/unlock.xml index d9d69d377aff..4c6d9ba7edc9 100644 --- a/reference/swoole/swoole/coroutine/lock/unlock.xml +++ b/reference/swoole/swoole/coroutine/lock/unlock.xml @@ -40,8 +40,8 @@ &reftitle.returnvalues; - Returns true if the lock was released successfully, - false otherwise. + Returns &true; if the lock was released successfully, + &false; otherwise. diff --git a/reference/win32service/rightinfo/get-full-username.xml b/reference/win32service/rightinfo/get-full-username.xml index d46664f59151..ea6e6831f2e4 100644 --- a/reference/win32service/rightinfo/get-full-username.xml +++ b/reference/win32service/rightinfo/get-full-username.xml @@ -26,7 +26,7 @@ &reftitle.returnvalues; - Return the domain and username or username if domain is null or &null; if no username found. + Return the domain and username or username if domain is &null; or &null; if no username found. From 4bbddadcaeb710bfd72d0103973dba82a4ba951b Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Date: Tue, 30 Jun 2026 12:07:44 +0200 Subject: [PATCH 2/2] Convert touched inline-only to Required by the DocBook style check on the paragraphs modified by this PR. --- language/types/declarations.xml | 4 ++-- reference/info/functions/ini-get.xml | 4 ++-- reference/intl/ini.xml | 4 ++-- reference/mbstring/functions/mb-strcut.xml | 4 ++-- reference/mbstring/functions/mb-substr.xml | 4 ++-- reference/pdo/pdo/getattribute.xml | 4 ++-- reference/reflection/reflectionenum/getbackingtype.xml | 8 ++++---- reference/swoole/swoole/coroutine/lock/lock.xml | 4 ++-- reference/swoole/swoole/coroutine/lock/trylock.xml | 4 ++-- reference/swoole/swoole/coroutine/lock/unlock.xml | 4 ++-- reference/win32service/rightinfo/get-full-username.xml | 4 ++-- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/language/types/declarations.xml b/language/types/declarations.xml index 7f5079f55884..03fc89f0b984 100644 --- a/language/types/declarations.xml +++ b/language/types/declarations.xml @@ -304,14 +304,14 @@ Stack trace: - + It is also possible to achieve nullable arguments by making &null; the default value. This is not recommended as if the default value is changed in a child class a type compatibility violation will be raised as the null type will need to be added to the type declaration. This behavior is also deprecated since PHP 8.4. - + Old way to make arguments nullable diff --git a/reference/info/functions/ini-get.xml b/reference/info/functions/ini-get.xml index 44f5f0b6e5d4..06080a59e817 100644 --- a/reference/info/functions/ini-get.xml +++ b/reference/info/functions/ini-get.xml @@ -35,11 +35,11 @@ &reftitle.returnvalues; - + Returns the value of the configuration option as a string on success, or an empty string for &null; values. Returns &false; if the configuration option doesn't exist. - + diff --git a/reference/intl/ini.xml b/reference/intl/ini.xml index b30622da9517..f3b1ee19c13e 100644 --- a/reference/intl/ini.xml +++ b/reference/intl/ini.xml @@ -51,13 +51,13 @@ string - + The locale that will be used in intl functions when none is specified (either by omitting the corresponding argument or by passing &null;). These are ICU locales, not system locales. The built-in ICU locales and their data can be explored at . - + The default value is empty, which forces the usage of ICU's default locale. Once set, the ini setting cannot be reset to this default value. diff --git a/reference/mbstring/functions/mb-strcut.xml b/reference/mbstring/functions/mb-strcut.xml index 76ca92a0aa72..c1b5085eb0e6 100644 --- a/reference/mbstring/functions/mb-strcut.xml +++ b/reference/mbstring/functions/mb-strcut.xml @@ -62,10 +62,10 @@ length - + Length in bytes. If omitted or &null; is passed, extract all bytes to the end of the string. - + If length is negative, the returned string will end at the length'th byte counting back from the diff --git a/reference/mbstring/functions/mb-substr.xml b/reference/mbstring/functions/mb-substr.xml index 0f6ee7e4d33b..7f769da05fdb 100644 --- a/reference/mbstring/functions/mb-substr.xml +++ b/reference/mbstring/functions/mb-substr.xml @@ -59,11 +59,11 @@ length - + Maximum number of characters to use from string. If omitted or &null; is passed, extract all characters to the end of the string. - + diff --git a/reference/pdo/pdo/getattribute.xml b/reference/pdo/pdo/getattribute.xml index 8264b76961cb..370d61cb4808 100644 --- a/reference/pdo/pdo/getattribute.xml +++ b/reference/pdo/pdo/getattribute.xml @@ -65,10 +65,10 @@ &reftitle.returnvalues; - + A successful call returns the value of the requested PDO attribute. An unsuccessful call returns &null;. - + diff --git a/reference/reflection/reflectionenum/getbackingtype.xml b/reference/reflection/reflectionenum/getbackingtype.xml index d922e280c9cf..9a7ec8a4a719 100644 --- a/reference/reflection/reflectionenum/getbackingtype.xml +++ b/reference/reflection/reflectionenum/getbackingtype.xml @@ -11,11 +11,11 @@ public ReflectionNamedTypenullReflectionEnum::getBackingType - + If the enumeration is a Backed Enum, this method will return an instance of ReflectionType for the backing type of the Enum. If it is not a Backed Enum, it will return &null;. - + @@ -26,10 +26,10 @@ &reftitle.returnvalues; - + An instance of ReflectionNamedType, or &null; if the Enum has no backing type. - + diff --git a/reference/swoole/swoole/coroutine/lock/lock.xml b/reference/swoole/swoole/coroutine/lock/lock.xml index a231d9c05e95..8983fb79ccb8 100644 --- a/reference/swoole/swoole/coroutine/lock/lock.xml +++ b/reference/swoole/swoole/coroutine/lock/lock.xml @@ -28,10 +28,10 @@ &reftitle.returnvalues; - + Returns &true; if the lock was acquired successfully, &false; otherwise. - + diff --git a/reference/swoole/swoole/coroutine/lock/trylock.xml b/reference/swoole/swoole/coroutine/lock/trylock.xml index 6c7e656cc534..f9faa0deb5ec 100644 --- a/reference/swoole/swoole/coroutine/lock/trylock.xml +++ b/reference/swoole/swoole/coroutine/lock/trylock.xml @@ -28,10 +28,10 @@ &reftitle.returnvalues; - + Returns &true; if the lock was acquired successfully, &false; if the lock is not available. - + diff --git a/reference/swoole/swoole/coroutine/lock/unlock.xml b/reference/swoole/swoole/coroutine/lock/unlock.xml index 4c6d9ba7edc9..ce1d7530a520 100644 --- a/reference/swoole/swoole/coroutine/lock/unlock.xml +++ b/reference/swoole/swoole/coroutine/lock/unlock.xml @@ -39,10 +39,10 @@ &reftitle.returnvalues; - + Returns &true; if the lock was released successfully, &false; otherwise. - + diff --git a/reference/win32service/rightinfo/get-full-username.xml b/reference/win32service/rightinfo/get-full-username.xml index ea6e6831f2e4..86f2b9d99990 100644 --- a/reference/win32service/rightinfo/get-full-username.xml +++ b/reference/win32service/rightinfo/get-full-username.xml @@ -25,9 +25,9 @@ &reftitle.returnvalues; - + Return the domain and username or username if domain is &null; or &null; if no username found. - +