3v4l.org

run code in 300+ PHP versions simultaneously
<?php $email = 'ExamplePerson+test@Gmail.com'; // Remove email tags, value will become 'ExamplePerson@Gmail.com' $email = preg_replace('/\+[^@]+@/', '@', $email); // Convert uppercase letters, value will become 'exampleperson@gmail.com' $email = strtolower($email); // Add prefix, value will become 'anon-hash:exampleperson@gmail.com' $email = 'anon-hash:'. $email; // Make the hash, value will become '56f1902ef780b12430ae194290057a40' $ahash = md5($email); // Or, in short: $email = 'ExamplePerson+test@Gmail.com'; $bhash = md5('anon-hash:' . strtolower(preg_replace('/\+[^@]+@/', '@', $email))); var_dump($ahash, $bhash);
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
string(32) "56f1902ef780b12430ae194290057a40" string(32) "56f1902ef780b12430ae194290057a40"

preferences:
214.23 ms | 405 KiB | 358 Q