Rename some standard array function parameters from $arr/$arg to $array #5974
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.
This is targeting 8.0, which is still in betas. Otherwise, we'd be stuck with current names until 9.0
$arg
seems like a poor choice of a name,especially if the function were to have arguments added.
In many cases, the php.net documentation already has $array for these functions.
E.g. https://www.php.net/manual/en/function.array-intersect.php
I'd assume that since named arguments was added to 8.0 close to the feature freeze,
PHP's maintainers had planned to make the names have some form of consistent naming rule within each module
and move the docs and implementation to be closer together for their name choice
@nikic - thoughts?
Note that this is already fairly large in scope, so if we notice anything related to fix such as
array $input
in https://www.php.net/array_reverse,I'd prefer it get added in a followup PR.