What are the risks of using outdated PHP functions like MD5 for password hashing and how can they be addressed?

Using outdated PHP functions like MD5 for password hashing poses a significant security risk as they are no longer considered secure due to their vulnerability to brute force attacks and rainbow table attacks. To address this issue, it is recommended to use stronger hashing algorithms like bcrypt or Argon2, which are specifically designed for secure password hashing.

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