3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php foreach (array( 'localpart.ending.with.dot.@example.com', '(comment)localpart@example.com', '"this is v@lid!"@example.com', '"much.more unusual"@example.com', 'postbox@com', 'admin@mailserver1', '"()<>[]:,;@\\"\\\\!#$%&\'*+-/=?^_`{}| ~.a"@example.org', '" "@example.org', '"a@b.com"<script>alert(document.cookie)</script>', 'a@b.com' ) as $address) { echo "$address is ".(filter_var($address, FILTER_VALIDATE_EMAIL) ? '' : 'not ')."valid\n"; } ?>
based on p9gPt
Output for 5.2.14 - 5.2.17, 5.3.3 - 7.1.0
localpart.ending.with.dot.@example.com is not valid (comment)localpart@example.com is not valid "this is v@lid!"@example.com is not valid "much.more unusual"@example.com is not valid postbox@com is not valid admin@mailserver1 is not valid "()<>[]:,;@\"\\!#$%&'*+-/=?^_`{}| ~.a"@example.org is not valid " "@example.org is not valid "a@b.com"<script>alert(document.cookie)</script> is not valid a@b.com is valid
Output for 5.2.11 - 5.2.13, 5.3.1 - 5.3.2
localpart.ending.with.dot.@example.com is valid (comment)localpart@example.com is not valid "this is v@lid!"@example.com is valid "much.more unusual"@example.com is valid postbox@com is valid admin@mailserver1 is not valid "()<>[]:,;@\"\\!#$%&'*+-/=?^_`{}| ~.a"@example.org is not valid " "@example.org is valid "a@b.com"<script>alert(document.cookie)</script> is not valid a@b.com is valid
Output for 5.2.9 - 5.2.10, 5.3.0
localpart.ending.with.dot.@example.com is valid (comment)localpart@example.com is not valid "this is v@lid!"@example.com is valid "much.more unusual"@example.com is valid postbox@com is valid admin@mailserver1 is valid "()<>[]:,;@\"\\!#$%&'*+-/=?^_`{}| ~.a"@example.org is not valid " "@example.org is valid "a@b.com"<script>alert(document.cookie)</script> is not valid a@b.com is valid
Output for 5.2.1 - 5.2.8
localpart.ending.with.dot.@example.com is not valid (comment)localpart@example.com is not valid "this is v@lid!"@example.com is valid "much.more unusual"@example.com is valid postbox@com is not valid admin@mailserver1 is not valid "()<>[]:,;@\"\\!#$%&'*+-/=?^_`{}| ~.a"@example.org is not valid " "@example.org is valid "a@b.com"<script>alert(document.cookie)</script> is not valid a@b.com is valid
Output for 5.2.0
localpart.ending.with.dot.@example.com is not valid (comment)localpart@example.com is not valid "this is v@lid!"@example.com is not valid "much.more unusual"@example.com is valid postbox@com is not valid admin@mailserver1 is not valid "()<>[]:,;@\"\\!#$%&'*+-/=?^_`{}| ~.a"@example.org is not valid " "@example.org is valid "a@b.com"<script>alert(document.cookie)</script> is not valid a@b.com is valid
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function filter_var() in /in/aibSa on line 14
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: filter_var() in /in/aibSa on line 14
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: filter_var() in /in/aibSa on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: filter_var() in /in/aibSa on line 14