3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $valid = array ( 'name@domain.com', 'name2@domain.com', 'l3tt3rsAndNumb3rs@domain.com', 'has-dash@domain.com', 'hasApostrophe.o\'leary@domain.org', 'uncommonTLD@domain.museum', 'uncommonTLD@domain.travel', 'uncommonTLD@domain.mobi', 'countryCodeTLD@domain.uk', 'countryCodeTLD@domain.rw', 'lettersInDomain@911.com', 'underscore_inLocal@domain.net', 'IPInsteadOfDomain@127.0.0.1', 'IPAndPort@127.0.0.1:25', 'subdomain@sub.domain.com', 'local@dash-inDomain.com', 'dot.inLocal@foo.com', 'a@singleLetterLocal.org', 'singleLetterDomain@x.org', '&*=?^+{}\'~@validCharsInLocal.net', ); $invalid = array ( 'missingDomain@.com', '@missingLocal.org', 'missingatSign.net', 'missingDot@com', 'two@@signs.com', 'colonButNoPort@127.0.0.1:', 'someone-else@127.0.0.1.26', '.localStartsWithDot@domain.com', 'localEndsWithDot.@domain.com', 'two..consecutiveDots@domain.com', 'domainStartsWithDash@-domain.com', 'domainEndsWithDash@domain-.com', 'TLDDoesntExist@domain.moc', 'numbersInTLD@domain.c0m', 'missingTLD@domain.', '! "#$%(),/;<>[]`|@invalidCharsInLocal.org', 'invalidCharsInDomain@! "#$%(),/;<>_[]`|.org', 'local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org', 'name@example.domain ); function valid($email) { echo filter_var($email, FILTER_VALIDATE_EMAIL) !== FALSE ? ' Valid' : 'Invalid',"\t\t{$email}\n"; } echo "Should be valid\n====================\n"; array_walk($valid, 'valid'); echo "\n\nShould be invalid\n====================\n"; array_walk($invalid, 'valid');
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.4.11
Parse error: syntax error, unexpected 'Valid' (T_STRING), expecting ')' in /in/sEepV on line 52
Process exited with code 255.
Output for 5.3.0 - 5.3.21
Parse error: syntax error, unexpected T_STRING, expecting ')' in /in/sEepV on line 52
Process exited with code 255.