xref: /PHP-7.2/ext/filter/tests/bug50158.phpt (revision 17ccbeec)
1--TEST--
2Bug #50158 (FILTER_VALIDATE_EMAIL fails with valid addresses containing = or ?)
3--SKIPIF--
4<?php if (!extension_loaded("filter")) die("skip"); ?>
5--FILE--
6<?php
7
8$email_address = "test=mail@example.com";
9var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
10
11$email_address = "test-mail@example.com";
12var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
13
14$email_address = "test+mail@example.com";
15var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
16
17$email_address = "test?mail@example.com";
18var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
19
20?>
21--EXPECTF--
22string(21) "test=mail@example.com"
23string(21) "test-mail@example.com"
24string(21) "test+mail@example.com"
25string(21) "test?mail@example.com"
26