What are the advantages of using SHA1 over md5() for password hashing in PHP applications?

The advantage of using SHA1 over md5() for password hashing in PHP applications is that SHA1 produces a longer hash value (160-bit) compared to md5() (128-bit), making it more secure against brute force attacks. Additionally, SHA1 is less prone to collisions, where two different inputs produce the same hash value. It is recommended to use SHA1 or even better, stronger hashing algorithms like bcrypt or Argon2 for password hashing in PHP applications.

$password = "password123";
$hashed_password = sha1($password);
echo $hashed_password;