mhash_get_hash_name()

mhash_get_hash_name() — Gets the name of the specified hash.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

The PHP manual marks this function as deprecated (since PHP 8.1): do not use it in new code.

Signature

mhash_get_hash_name(int $algo): string|false

Parameters

ParameterTypeWhat it takes
$algointThe hash ID. One of the MHASH_hashname constants.

Return value

Returns the name of the hash or false, if the hash does not exist.

Example

A runnable snippet:

echo mhash_get_hash_name(MHASH_MD5); // MD5

Changelog

VersionChange
8.1.0This function has been deprecated. Use the hash_*() functions instead.

All PHP 8.5 built-in functions

Reference card built from the PHP manual page mhash_get_hash_name() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.