Home
DevCentral
Search
Configure Global Search
Log In
Transactions
T1544
Change Details
Change Details
Old
New
Diff
PHP 7.4 introduced mb_str_split(), which roughly do the same than our for loop in OmniString::getBigrams code. That means: ```lang=php public function getBigrams () { $bigrams = []; $len = $this->len(); for ($i = 0 ; $i < $len - 1 ; $i++) { $bigrams[] = mb_substr($this->value, $i, 2, $this->encoding); } return $bigrams; } ``` Could in PHP 7.4+ rewritten as: ```lang=php public function getBigrams () { return mb_str_split($this->value, 2, $this->encoding); } ```
PHP 7.4 introduced mb_str_split(), which roughly do the same than our for loop in OmniString::getBigrams code. That means: ```lang=php public function getBigrams () { $bigrams = []; $len = $this->len(); for ($i = 0 ; $i < $len - 1 ; $i++) { $bigrams[] = mb_substr($this->value, $i, 2, $this->encoding); } return $bigrams; } ``` Could in PHP 7.4+ rewritten as: ```lang=php public function getBigrams () { return mb_str_split($this->value, 2, $this->encoding); } ``` Reference: https://wiki.php.net/rfc/mb_str_split
PHP 7.4 introduced mb_str_split(), which roughly do the same than our for loop in OmniString::getBigrams code. That means: ```lang=php public function getBigrams () { $bigrams = []; $len = $this->len(); for ($i = 0 ; $i < $len - 1 ; $i++) { $bigrams[] = mb_substr($this->value, $i, 2, $this->encoding); } return $bigrams; } ``` Could in PHP 7.4+ rewritten as: ```lang=php public function getBigrams () { return mb_str_split($this->value, 2, $this->encoding); } ```
Reference: https://wiki.php.net/rfc/mb_str_split
Continue