What are the advantages of using modern hashing algorithms over md5 for password storage in PHP applications?

Using modern hashing algorithms such as bcrypt or Argon2 over md5 for password storage in PHP applications is crucial for security reasons. md5 is considered to be a weak hashing algorithm and can be easily cracked using modern computing power. On the other hand, bcrypt and Argon2 are designed to be slow and computationally intensive, making it much harder for attackers to brute force passwords.

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

// Verifying password
$entered_password = "secret_password";
if (password_verify($entered_password, $hashed_password)) {
    echo "Password is correct";
} else {
    echo "Password is incorrect";
}