3v4l.org

run code in 300+ PHP versions simultaneously
<?php $emails = array( 'test@example.com', 'test.derp@example.com', 'test+nick@example.com', 'abc."defghi".xyz@example.com', '"abcdefghixyz"@example.com', 'jsmith@[192.168.2.1]', 'jsmith@[IPv6:2001:db8::1]', 'long.but.still.perfectly.valid.email.address@on.even.longer.domain.name.owned.by.some.weird.name.company.which.name.you.cannot.pronounce.com', 'other.email-with-dash@example.com', '"much.more unusual"@example.com', '"very.unusual.@.unusual.com"@example.com', '"very.(),:;<>[]\".VERY.\"very@\\ \"very\".unusual"@strange.example.com', 'admin@mailserver1 (local domain name with no TLD)', '#!$%&\'*+-/=?^_`{}|~@example.org', '"()<>[]:,;@\\\"!#$%&\'*+-/=?^_`{}| ~.a"@example.org', '" "@example.org (space between the quotes)', '☃☃☃@example.com (Unicode characters in local part)', '☃☃☃@☃☃☃.com (Unicode characters in domain part)', 'new@domain.pizza' ); foreach ($emails as $email) { echo (filter_var($email, FILTER_VALIDATE_EMAIL)) ? "[+] Email $email is valid\n" : "[-] Email $email is NOT valid\n"; }

preferences:
71.98 ms | 404 KiB | 5 Q