Skip to content

Deprecate mhash constants #16569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/hash/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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); */
Expand Down
22 changes: 22 additions & 0 deletions ext/hash/tests/mhash_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 22 additions & 0 deletions ext/hash/tests/mhash_003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions ext/hash/tests/mhash_004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down