What are the potential security risks of trying to reverse engineer an md5 hash in PHP for password retrieval?

When trying to reverse engineer an md5 hash in PHP for password retrieval, one potential security risk is that md5 is a weak hashing algorithm that can be easily cracked using rainbow tables or brute force attacks. To mitigate this risk, it is recommended to use a more secure hashing algorithm like bcrypt or Argon2 for storing passwords.

// Using bcrypt for password hashing
$password = "password123";
$hashed_password = password_hash($password, PASSWORD_BCRYPT);

// Verify password
if (password_verify($password, $hashed_password)) {
    echo "Password is valid!";
} else {
    echo "Invalid password!";
}