The password_hash() function is used to check whether the hash value matches the specified options.
PHP version requirements: PHP 5 >= 5.5.0, PHP 7
bool password_needs_rehash ( string $hash , int $algo [, array $options ] )
Parameter description:
hash: A hash value created by password_hash().
algo: A cryptographic algorithm constant used to indicate the algorithm used when hashing passwords.
options: an associative array containing options. Currently, two options are supported: salt, the salt (interference string) added when hashing the password, and cost, which is used to specify the number of levels of algorithm recursion. Examples of these two values can be found on the crypt() page. When omitted, a random salt value and default cost will be used.
This function detects whether the specified hash value implements the provided algorithm and options. If not, the hash value needs to be regenerated.