rfc:deprecate-inconsistent-cast-keywords

This is an old revision of the document!


PHP RFC: Your Title Here

Introduction

Scalar type declarations use only a single name for each numeric type, but casts permit some variation. This RFC proposes to deprecate the variants that are not valid as type declarations for reasons of consistency.

Proposal

The following cast forms will emit E_DEPRECATED errors, with a schedule for removal to be agreed either during discussion of this RFC or in a subsequent RFC:

(integer) // use (int)
(boolean) // use (bool)
(double)  // use (float)
(real)    // use (float)

The main reason for this is to help ensure that code is consistent and obviously readable.

Backward Incompatible Changes

Any code which uses these cast forms will now emit E_DEPRECATED errors.

Proposed PHP Version(s)

PHP 7.3

Unaffected PHP Functionality

List existing areas/features of PHP that will not be changed by the RFC.

This helps avoid any ambiguity, shows that you have thought deeply about the RFC's impact, and helps reduces mail list noise.

Future Scope

This sections details areas where the feature might be improved in future, but that are not currently proposed in this RFC.

Proposed Voting Choices

Yes/No, with a 2/3 majority required.

Patches and Tests

No implementation currently exists.

References

Links to external references, discussions or RFCs

rfc/deprecate-inconsistent-cast-keywords.1512663216.txt.gz · Last modified: 2017/12/07 16:13 by daverandom