From c140370c354496b38b97dfafe2e31f3f8df8bb44 Mon Sep 17 00:00:00 2001 From: Yoshinari Takaoka Date: Sat, 27 Nov 2021 01:38:00 +0900 Subject: [PATCH] Document autovivification from false deprecation. (#1126) --- language/types/array.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/language/types/array.xml b/language/types/array.xml index a8e2985d7f9d..226936b83d0f 100644 --- a/language/types/array.xml +++ b/language/types/array.xml @@ -422,7 +422,7 @@ $arr[] = value; // value may be any value of any type - If $arr doesn't exist yet, it will be created, so this is + If $arr doesn't exist yet or is set to &null; or &false;, it will be created, so this is also an alternative way to create an array. This practice is however discouraged because if $arr already contains some value (e.g. string from request variable) then this @@ -437,6 +437,12 @@ $arr[] = value; error. Formerly, the string was silently converted to an array. + + + As of PHP 8.1.0, creating a new array from &false; value is deprecated. + Creating a new array from &null; and undefined values is still allowed. + + To change a certain