diff --git a/UPGRADING b/UPGRADING index 07cee36eb42..0f7b61d71b9 100644 --- a/UPGRADING +++ b/UPGRADING @@ -56,6 +56,11 @@ PHP 8.5 UPGRADE NOTES 4. Deprecated Functionality ======================================== +- Hash: + The MHASH_* constants have been deprecated. These have been overlooked + when the mhash*() function family has been deprecated per + https://wiki.php.net/rfc/deprecations_php_8_1#mhash_function_family + ======================================== 5. Changed Functions ======================================== diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 9d099c2d50b..fbfcf485e1d 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -1189,7 +1189,7 @@ static void mhash_init(INIT_FUNC_ARGS) } len = slprintf(buf, 127, "MHASH_%s", algorithm.mhash_name); - zend_register_long_constant(buf, len, algorithm.value, CONST_PERSISTENT, module_number); + zend_register_long_constant(buf, len, algorithm.value, CONST_PERSISTENT|CONST_DEPRECATED, module_number); } /* TODO: this cause #69823 zend_register_internal_module(&mhash_module_entry); */ diff --git a/ext/hash/tests/mhash_001.phpt b/ext/hash/tests/mhash_001.phpt index 6b2011b2f1f..29f0f473380 100644 --- a/ext/hash/tests/mhash_001.phpt +++ b/ext/hash/tests/mhash_001.phpt @@ -35,56 +35,78 @@ foreach ($supported_hash_al as $hash=>$wanted) { } ?> --EXPECTF-- +Deprecated: Constant MHASH_MD5 is deprecated in %s on line %d + Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d MHASH_MD5 ok +Deprecated: Constant MHASH_SHA1 is deprecated in %s on line %d + Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d MHASH_SHA1 ok +Deprecated: Constant MHASH_HAVAL256 is deprecated in %s on line %d + Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d MHASH_HAVAL256 ok +Deprecated: Constant MHASH_HAVAL192 is deprecated in %s on line %d + Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d MHASH_HAVAL192 ok +Deprecated: Constant MHASH_HAVAL224 is deprecated in %s on line %d + Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d MHASH_HAVAL224 ok +Deprecated: Constant MHASH_HAVAL160 is deprecated in %s on line %d + Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d MHASH_HAVAL160 ok +Deprecated: Constant MHASH_RIPEMD160 is deprecated in %s on line %d + Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d MHASH_RIPEMD160 ok +Deprecated: Constant MHASH_GOST is deprecated in %s on line %d + Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d MHASH_GOST ok +Deprecated: Constant MHASH_TIGER is deprecated in %s on line %d + Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d MHASH_TIGER ok +Deprecated: Constant MHASH_CRC32 is deprecated in %s on line %d + Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d MHASH_CRC32 ok +Deprecated: Constant MHASH_CRC32B is deprecated in %s on line %d + Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d MHASH_CRC32B ok diff --git a/ext/hash/tests/mhash_003.phpt b/ext/hash/tests/mhash_003.phpt index 26c54af6feb..f39e1ff387c 100644 --- a/ext/hash/tests/mhash_003.phpt +++ b/ext/hash/tests/mhash_003.phpt @@ -35,56 +35,78 @@ foreach ($supported_hash_al as $hash=>$wanted) { } ?> --EXPECTF-- +Deprecated: Constant MHASH_MD5 is deprecated in %s on line %d + Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d MHASH_MD5 ok +Deprecated: Constant MHASH_SHA1 is deprecated in %s on line %d + Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d MHASH_SHA1 ok +Deprecated: Constant MHASH_HAVAL256 is deprecated in %s on line %d + Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d MHASH_HAVAL256 ok +Deprecated: Constant MHASH_HAVAL224 is deprecated in %s on line %d + Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d MHASH_HAVAL224 ok +Deprecated: Constant MHASH_HAVAL192 is deprecated in %s on line %d + Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d MHASH_HAVAL192 ok +Deprecated: Constant MHASH_HAVAL160 is deprecated in %s on line %d + Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d MHASH_HAVAL160 ok +Deprecated: Constant MHASH_RIPEMD160 is deprecated in %s on line %d + Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d MHASH_RIPEMD160 ok +Deprecated: Constant MHASH_GOST is deprecated in %s on line %d + Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d MHASH_GOST ok +Deprecated: Constant MHASH_TIGER is deprecated in %s on line %d + Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d MHASH_TIGER ok +Deprecated: Constant MHASH_CRC32 is deprecated in %s on line %d + Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d MHASH_CRC32 ok +Deprecated: Constant MHASH_CRC32B is deprecated in %s on line %d + Deprecated: Function mhash_keygen_s2k() is deprecated since 8.1 in %s on line %d MHASH_CRC32B ok diff --git a/ext/hash/tests/mhash_004.phpt b/ext/hash/tests/mhash_004.phpt index 7087b090fab..e47d48eb1a5 100644 --- a/ext/hash/tests/mhash_004.phpt +++ b/ext/hash/tests/mhash_004.phpt @@ -12,6 +12,7 @@ var_dump($algo); ?> --EXPECTF-- +Deprecated: Constant MHASH_MD5 is deprecated in %s on line %d int(1) Deprecated: Function mhash() is deprecated since 8.1 in %s on line %d