mhash_count()
mhash_count() — Gets the highest available hash ID.
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_count(): int
Parameters
This function takes no parameters.
Return value
Returns the highest available hash ID. Hashes are numbered from 0 to this hash ID.
Example
A runnable snippet:
$nr = mhash_count(); for ($i = 0; $i <= $nr; $i++) { echo sprintf("The blocksize of %s is %d\n", mhash_get_hash_name($i), mhash_get_block_size($i)); }
Changelog
| Version | Change |
|---|---|
| 8.1.0 | This 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_count() (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.