|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70054 Mistype error
Submitted: 2015-07-12 15:53 UTC Modified: 2015-07-12 17:23 UTC
From: support at cattechsol dot com Assigned: cmb (profile)
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
15 + 13 = ?
Subscribe to this entry?

 [2015-07-12 15:53 UTC] support at cattechsol dot com
From manual page:
In PHP Filter Email Validation there is mistype error in the first example. 

$email_a = '';
$email_b = 'bogus';

if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
    echo "This ($email_a) email address is considered valid.";
if (filter_var($email_b, FILTER_VALIDATE_EMAIL)) {
    echo "This ($email_b) email address is considered valid.";

Both the bogus and valid are given valid emails...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-12 17:23 UTC]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2015-07-12 17:23 UTC]
The example is correct. For the second address ("bogus")
filter_var() returns false, and so the echo statement is not
executed. The output can be seen below the example.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Dec 03 21:01:23 2020 UTC