xref: /PHP-8.1/ext/filter/tests/bug50158.phpt (revision 74859783)
1--TEST--
2Bug #50158 (FILTER_VALIDATE_EMAIL fails with valid addresses containing = or ?)
3--EXTENSIONS--
4filter
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--EXPECT--
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