rfc:consistent-names
PHP RFC: Use alias to provide both legacy and consistent names
- Version: 0.9
- Date: 2014-01-23
- Author: Yasuo Ohgaki, yohgaki@ohgaki.net
- Status: Inactive
- First Published at: http://wiki.php.net/rfc/consistent-names
Introduction
PHP has been developed about 20 years. Many legacy functions/methods do not comply CODING_STANDARDS “Naming Conventions”.
Inconsistent names are not appealing for new users. Having consistent names would help to assure PHP's attractiveness to learn. Older names should be usable for compatibility.
Both consistency and compatibility is mandatory, aliases may be used.
Proposal
Add CODING_STANDARDS compliant name as default name and add legacy name as alias.
- De facto standard names like string operation function (e.g. strcmp()) remains as it is now.
- Other names like mb_encode_mimeheader() become alias of mb_encode_mime_header().
- Names in question are discussed in internals@lists.php.net
- Aliases are not deprecated and should remain at least next 10 years or more.
Backward Incompatible Changes
None.
Proposed PHP Version(s)
5.7 or later
SAPIs Impacted
None
Impact to Existing Extensions
Many extensions would have aliases.
New Constants
There may be constants that may have better names(?)
php.ini Defaults
No php.ini
Open Issues
Decide which names to be “De factt standard”
Proposed Voting Choices
Yes/No
Patches and Tests
It's a simple aliasing.
Implementation
After the project is implemented, this section should contain
- the version(s) it was merged to
- a link to the git commit(s)
- a link to the PHP manual entry for the feature
References
Rejected Features
rfc/consistent-names.txt · Last modified: 2021/03/27 14:32 by ilutov