2.2.0
This project now requires PHP 7.1 or newer.
New sniff added: MoxioSniffs.PHP.DisallowMbDetectEncoding
, which disallows usage of mb_detect_encoding
. This function has a misleading name that implies it can actually detect the encoding of a string, a problem which is generally impossible. Rather it checks a list of encodings until it finds one that could be the right one (i.e. the string is a valid byte sequence according to that encoding). Using mb_check_encoding
(possibly in a loop) instead makes this much more explicit. See this talk for more background information on this topic.