Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions language/types/array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,10 @@ var_dump($arr);

<note>
<para>
As mentioned above, if no key is specified, the maximum of the existing
<type>int</type> indices is taken, and the new key will be that maximum
value plus 1 (but at least 0). If no <type>int</type> indices exist yet, the key will
be <literal>0</literal> (zero).
As mentioned above, if no key is specified, PHP uses the next integer key: the
maximum existing integer index + <literal>1</literal>. If the array currently has no integer
indices, the key will be <literal>0</literal> (zero). For the historical behaviour prior to
<literal>PHP 8.3.0</literal> — where appending after a negative key could yield <literal>0</literal> — see Example #7.
Comment thread
Narkunan marked this conversation as resolved.
Outdated
Comment thread
Narkunan marked this conversation as resolved.
Outdated
</para>

<para>
Expand Down