rfc:the_naming_convention_for_internal_functions_arguments

PHP RFC: Naming convention for the internal PHP function's arguments

Introduction

Since PHP is now supporting the named params. It will be important to set a -draft- naming convention for the internals functions parameters.

PHP has function families, e.g. string's functions family, array's functions family, and so forth. Fortunately, most of these function shares the same argument naming. but there are some of them that do not.

Proposal

Sharing the same arguments naming with all similar functions.

Most array_* functions accept the first argument ( Input arguments ) as a variable named $array.

But there are some functions that does not, like `in_array()`, `array_search()`, `count()` ... etc.

This is the same for the str_* functions. Most of them share the `$string` argument as an input argument but some functions like `strpos()`, `stripos()` do not.

Backward Incompatible Changes

This will break users who are already using the named arguments on 8.0 and 8.1 versions.

Proposed PHP Version(s)

PHP8.2

Open Issues

Make sure there are no open issues when the vote starts!

Proposed Voting Choices

Include these so readers know where you are heading and can discuss the proposed voting options.

Implementation

References

Links to external references, discussions or RFCs

Rejected Features

rfc/the_naming_convention_for_internal_functions_arguments.txt · Last modified: 2021/12/08 16:38 by hassan