password_needs_rehash

Supported Versions: PHP 5 >= 5.5.0, PHP 7, PHP 8
Checks if the given hash matches the given options
password_needs_rehash(string $hashstring|int|null $algo, array $options = []): bool
    public function needsRehash($hashedValue, array $options = [])

    {

        return 
password_needs_rehash($hashedValue$this->algorithm(), [

            
'memory_cost' => $this->memory($options),

            
'time_cost' => $this->time($options),

            
'threads' => $this->threads($options),

        ]);

    }
    public function needsRehash($hashedValue, array $options = [])

    {

        return 
password_needs_rehash($hashedValuePASSWORD_BCRYPT, [

            
'cost' => $this->cost($options),

        ]);

    }