What are the potential pitfalls of encrypting passwords with MD5 multiple times?

Encrypting passwords with MD5 multiple times can lead to a false sense of security as MD5 is not a secure hashing algorithm for passwords due to its vulnerability to brute force attacks and collisions. It is recommended to use a more secure hashing algorithm such as bcrypt or Argon2 for password hashing to ensure better security.

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