What are the potential security risks of using SHA1 for hashing in PHP authentication systems?

Using SHA1 for hashing in PHP authentication systems poses a security risk due to its vulnerability to collision attacks, where different inputs can produce the same hash value. To mitigate this risk, it is recommended to use stronger hashing algorithms like SHA256 or SHA512.

// Using SHA256 for hashing in PHP authentication systems
$password = "password123";
$hashed_password = hash('sha256', $password);