Verifier support for CheckROCOW
[hiphop-php.git] / hphp / test / quick / normalize.php
blobd34f181343d56ac370fb291ce9b13d0bbd749780
1 <?hh
4 function utf8_strtolower($str): string {
5 return mb_strtolower($str, 'utf-8');
8 function normalize_email($email, $strip_slashes = false): string {
9 $ret_email = trim(utf8_strtolower($email), " \t\r\n\0\x0B.");
10 if ($strip_slashes) {
11 $ret_email = stripslashes($ret_email);
14 return $ret_email;
16 <<__EntryPoint>> function main(): void {
17 var_dump(normalize_email('xxxxxxxxxx@yyyyy.com'.str_repeat(' ',1518)));