rfc:deprecate-unuseful-crypt-constants

PHP RFC: Deprecate always `1` MCRYPT_* constants

Introduction

`CRYPT_*` constants do not currently provide any value. Since PHP 5.6 their value is hardcoded to `1`.

Historically, they were used to signal a hash algo is supported, but as of PHP 5.6, all algos are required to be present by the configure script. If any new crypt algo will be added in the future, semver (PHP minor version) is enough for the developer to test the availability.

Removing unuseful constants is welcomed to reduce the engine startup time and binary/memory size.

Proposal

Deprecate `CRYPT_STD_DES`, `CRYPT_EXT_DES`, `CRYPT_MD5`, `CRYPT_BLOWFISH`, `CRYPT_SHA256`, `CRYPT_SHA512` constants in PHP 8.3 and remove them in PHP 9.0

Backward Incompatible Changes

Implied by the proposal. No opcache/sapi change needed.

Proposed PHP Version(s)

PHP 8.3

Proposed Voting Choices

Deprecate `MCRYPT_*` constants in PHP 8.3. (yes/no)

Remove `MCRYPT_*` constants in PHP 9.0. (yes/no)

rfc/deprecate-unuseful-crypt-constants.txt · Last modified: 2023/03/09 12:42 by mvorisek