What are the potential pitfalls of using MD5 for password hashing in PHP?

Using MD5 for password hashing in PHP is not secure because it is considered a weak hashing algorithm that can be easily cracked using modern hardware. It is susceptible to brute force attacks and rainbow table attacks, making it unsuitable for storing sensitive information such as passwords. To improve security, it is recommended to use stronger hashing algorithms like bcrypt or Argon2.

// Use bcrypt for password hashing in PHP
$hashedPassword = password_hash($password, PASSWORD_BCRYPT);