Skip to content

Rename some standard array function parameters from $arr/$arg to $array #5974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

TysonAndre
Copy link
Contributor

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.

This is targeting 8.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 near the feature freeze,
PHP's maintainers had planned to make the names consistent
and gradually use the same name for  docs and implementation.
@kocsismate
Copy link
Member

kocsismate commented Aug 11, 2020

I'm certainly in favour of these changes!

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

A few PRs have already been merged (e.g. #5847) to clean up a few parameter names, and there is also a pending task for this with some suggestions: php/php-tasks#16. In addition, we have a POC PR to autogenerate function/method signatures for the documentation based on the stubs #5895

@TysonAndre
Copy link
Contributor Author

Closed by 1e9a5c6

@TysonAndre TysonAndre closed this Aug 12, 2020
@TysonAndre TysonAndre deleted the array-standard_function-stub-regen branch November 25, 2021 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants