Updated notes for example 10 in arrays page#5578
Open
Narkunan wants to merge 1 commit into
Open
Conversation
| 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. |
Member
There was a problem hiding this comment.
Why is PHP a literal value?
Member
There was a problem hiding this comment.
We shouldn't mention PHP at all. It falls under the same category as using "you". Instead I prefer to use the following type of phrasing. As Kamil also suggested.
As mentioned above, if no key is specified, the next integer key will be used: the maximum existing integer index + 1.
Member
There was a problem hiding this comment.
Yes, correct, but also the old "as mentioned above" is super ambiguous.
Member
|
Was this written with AI? |
Comment on lines
+537
to
+540
| 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. |
Member
There was a problem hiding this comment.
Suggested change
| 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. | |
| If no key is specified, the key will be the | |
| maximum existing integer index + <literal>1</literal>. If the array has no positive | |
| integer indices, the key will be <literal>0</literal>. | |
| As of PHP 8.3.0, it can also be a negative integer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: #4788