What potential pitfalls should be considered when storing IP addresses for user identification in PHP applications?

One potential pitfall when storing IP addresses for user identification in PHP applications is the risk of exposing sensitive user information if the data is not properly secured. To mitigate this risk, it is important to hash the IP addresses before storing them in the database. This adds an extra layer of security and helps protect user privacy.

// Hash the user's IP address before storing it in the database
$ipAddress = $_SERVER['REMOTE_ADDR'];
$hashedIpAddress = hash('sha256', $ipAddress);
// Store $hashedIpAddress in the database