Code Duplication    Length = 3-3 lines in 2 locations

Str.php 2 locations

@@ 173-175 (lines=3) @@
170
        $result = [];
171
        $length = mb_strlen($haystack, $encoding ?: static::encoding($haystack));
172
173
        for ($idx = 0; $idx < $length; $idx++) {
174
            $result[] = mb_substr($haystack, $idx, 1, $encoding);
175
        }
176
177
        return $result;
178
    }
@@ 837-839 (lines=3) @@
834
        }
835
836
        // Reverse one character after the other, counting from the end.
837
        for ($i = $length - 1; $i >= 0; $i--) {
838
            $result .= mb_substr($str, $i, 1, $encoding);
839
        }
840
841
        return $result;
842
    }