|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #55865 email cyrillic symbols contains are not valid at filter_var function
Submitted: 2011-10-07 15:02 UTC Modified: 2016-11-21 14:25 UTC
Avg. Score:4.8 ± 0.4
Reproduced:5 of 6 (83.3%)
Same Version:3 (60.0%)
Same OS:3 (60.0%)
From: mitallast at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Filter related
PHP Version: 5.3.8 OS: nix*, mac
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: mitallast at gmail dot com
New email:
PHP Version: OS:


 [2011-10-07 15:02 UTC] mitallast at gmail dot com
Php contains filter_var function with predefined constaint FILTER_VALIDATE_EMAIL.
This function incorrect validate email with cyrrilic symbols.
Error can be at file "ext/filter/logical_filters.c" at function "void 

Test script:
$value = "тест@тест.рф";
var_dump(filter_var($value, FILTER_VALIDATE_EMAIL));

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-25 09:03 UTC] enderstd at gmail dot com
I think this behaviour is all right. There is a punycode form for IDN domains, 
filter_var undestands it well enough, yet not without some issues. But I think 
punycode is way to go.

And by the way, "тест@тест.рф" is invalid email anyway, because mailbox can't 
contain IDN characters, I think it violates some basic SMTP RFC. Valid domain 
would be like "test@тест.рф".
 [2012-07-15 00:00 UTC] doomasmile at gmail dot com

Function must be refactored.
 [2015-06-15 23:26 UTC]
-Type: Bug +Type: Feature/Change Request -Package: *Mail Related +Package: Filter related
 [2015-06-15 23:26 UTC]
Actually, this is not a bug, because the documentation[1] states:

| In general, this validates e-mail addresses against the syntax
| in RFC 822, [...]

However, IDNs are not allowed by RFC 822, let alone local parts
with non ASCII characters; these are subject of RFC 6530-6533.
Therefore I'm switching to feature request, and do not mark this
ticket as duplicate of request #39469, because that request is
only about IDN support.

[1] <>
 [2016-11-21 14:25 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2016-11-21 14:25 UTC]
Unicode in the local-part of email addresses is supported through
the FILTER_FLAG_EMAIL_UNICODE flag as of PHP 7.1.0, see

Support for IDN is already covered by request #39469, so I'm
closing this ticket.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri May 20 08:05:44 2022 UTC