diff --git a/src/StringUtil.php b/src/StringUtil.php index 4fa1613..b78b200 100644 --- a/src/StringUtil.php +++ b/src/StringUtil.php @@ -46,10 +46,8 @@ private static function findCommonPrefix(string $string1, string $string2): stri if (!isset($string2[$i]) || $string1[$i] != $string2[$i]) { break; } - - $prefix .= $string1[$i]; } - return $prefix; + return substr($string1, 0, $i); } }