Skip to content

Commit

Permalink
Document autovivification from false deprecation. (#1126)
Browse files Browse the repository at this point in the history
  • Loading branch information
mumumu committed Nov 26, 2021
1 parent 669c19f commit c140370
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion language/types/array.xml
Expand Up @@ -422,7 +422,7 @@ $arr[] = <replaceable>value</replaceable>;
// <replaceable>value</replaceable> may be any value of any type</synopsis>

<para>
If <varname>$arr</varname> doesn't exist yet, it will be created, so this is
If <varname>$arr</varname> 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 <type>array</type>. This practice is
however discouraged because if <varname>$arr</varname> already contains
some value (e.g. <type>string</type> from request variable) then this
Expand All @@ -437,6 +437,12 @@ $arr[] = <replaceable>value</replaceable>;
error. Formerly, the string was silently converted to an array.
</simpara>
</note>
<note>
<simpara>
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.
</simpara>
</note>

<para>
To change a certain
Expand Down

0 comments on commit c140370

Please sign in to comment.