What potential pitfalls should be considered when using password_hash() and password_verify() for secure authentication in PHP?

One potential pitfall to consider when using password_hash() and password_verify() for secure authentication in PHP is the possibility of using weak hashing algorithms or not properly salting the passwords, which can make them vulnerable to brute force attacks. To mitigate this risk, it is important to use a strong hashing algorithm like bcrypt and generate a unique salt for each password.

$password = "password123";
$options = [
    'cost' => 12,
];
$hashed_password = password_hash($password, PASSWORD_BCRYPT, $options);

// To verify the password
$entered_password = "password123";
if (password_verify($entered_password, $hashed_password)) {
    // Password is correct
} else {
    // Password is incorrect
}