3v4l.org

run code in 200+ php & hhvm versions
<?php $emails = [ "john.doe@example.com", "joh````oe@example.com", "john@.doe@example.com", "@example.com", "john.doe@example", ]; foreach($emails as $email){ if (filter_var($email, FILTER_VALIDATE_EMAIL)) { echo "$email is a valid email address\n"; } else { echo"$email is not a valid email address\n"; } }
based on OoqnT
Output for 7.1.25 - 7.4.0beta4
john.doe@example.com is a valid email address joh````oe@example.com is a valid email address john@.doe@example.com is not a valid email address @example.com is not a valid email address john.doe@example is not a valid email address