What potential pitfalls should be considered when using md5 hashes in PHP for security purposes?

Using md5 hashes in PHP for security purposes is not recommended due to its vulnerability to collisions and being easily reversible. It is better to use more secure hashing algorithms like bcrypt or sha256 for storing sensitive data securely.

// Use bcrypt hashing algorithm instead of md5
$password = "password123";
$hashed_password = password_hash($password, PASSWORD_DEFAULT);