What are the potential pitfalls of using the md5 hash function for passwords in PHP?

Using the md5 hash function for passwords in PHP is not recommended due to its vulnerability to brute force attacks and rainbow table attacks. It is considered a weak hashing algorithm for password storage. To improve security, it is recommended to use stronger hashing algorithms like bcrypt or Argon2.

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