What are some potential pitfalls of using MD5 to encrypt passwords in PHP?

Using MD5 to encrypt passwords in PHP is not secure because MD5 is considered a weak hashing algorithm and can be easily cracked using modern computing power. It is recommended to use stronger hashing algorithms like bcrypt or Argon2 for securely storing passwords.

// Using bcrypt to securely hash passwords
$hashed_password = password_hash($password, PASSWORD_BCRYPT);