# RFC: Deprecate Inconsistent Cast Names

- Status: Inactive
- Authors: Chris Wright daverandom@php.net
- Date: 2017-12-07
- Version: 1.0
- Original: https://wiki.php.net/rfc/deprecate-inconsistent-cast-keywords
- Page: https://externals.io/rfc/deprecate-inconsistent-cast-keywords
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

## Discussions on the mailing list

No thread found.

---

## 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:

```php
(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

## 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
