When should MD5 encryption be used for passwords in PHP applications?

MD5 encryption should not be used for passwords in PHP applications as it is considered insecure and easily crackable. Instead, it is recommended to use stronger hashing algorithms such as bcrypt or Argon2 for securely storing passwords.

$password = "password123";
$hashed_password = password_hash($password, PASSWORD_BCRYPT);