Incorrect case close operands

This commit is contained in:
Yuriy Pikhtarev 2017-01-30 22:41:02 +03:00
commit a978ae260a
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
7 changed files with 22 additions and 19 deletions

View file

@ -3072,21 +3072,21 @@ class utf8
} #speed improve
switch (strlen($char)) {
case 1 :
case 1:
return $cache[$char] = ord($char);
case 2 :
case 2:
return $cache[$char] = (ord($char{1}) & 63) |
((ord($char{0}) & 31) << 6);
case 3 :
case 3:
return $cache[$char] = (ord($char{2}) & 63) |
((ord($char{1}) & 63) << 6) |
((ord($char{0}) & 15) << 12);
case 4 :
case 4:
return $cache[$char] = (ord($char{3}) & 63) |
((ord($char{2}) & 63) << 6) |
((ord($char{1}) & 63) << 12) |
((ord($char{0}) & 7) << 18);
default :
default:
trigger_error('Character 0x' . bin2hex($char) . ' is not UTF-8!', E_USER_WARNING);
return false;
}