PHPackages                             s9e/longest-common-substring - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. s9e/longest-common-substring

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

s9e/longest-common-substring
============================

Longest common substring generator

1.0.0(3y ago)04MITPHPPHP &gt;=8.0

Since Sep 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/s9e/LongestCommonSubstring)[ Packagist](https://packagist.org/packages/s9e/longest-common-substring)[ Docs](https://github.com/s9e/LongestCommonSubstring/)[ RSS](/packages/s9e-longest-common-substring/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

s9e\\LongestCommonSubstring takes a list of strings and returns a single string that is contained in all of the given input. The implementation is designed for sets where the shortest input string is 10-20 bytes long at most, and where a common substring is not guaranteed to exist. For large input, you'll want to use a different implementation.

Usage
-----

[](#usage)

```
$lcs = new s9e\LongestCommonSubstring\LongestCommonSubstring;
var_dump($lcs->get(['abcdxyz', 'xyzabcd']));
```

```
string(4) "abcd"

```

```
$lcs = new s9e\LongestCommonSubstring\LongestCommonSubstring;
var_dump($lcs->get(['foo', 'bar']));
```

```
string(0) ""

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1339d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/06ce60f935a636cbb13d7ca4733fa28c9a2c9d500834c6481f86e05fd4a55e86?d=identicon)[s9e](/maintainers/s9e)

---

Top Contributors

[![JoshyPHP](https://avatars.githubusercontent.com/u/317712?v=4)](https://github.com/JoshyPHP "JoshyPHP (11 commits)")

---

Tags

lcs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/s9e-longest-common-substring/health.svg)

```
[![Health](https://phpackages.com/badges/s9e-longest-common-substring/health.svg)](https://phpackages.com/packages/s9e-longest-common-substring)
```

###  Alternatives

[umpirsky/symfony-upgrade-fixer

Analyzes your Symfony project and tries to make it compatible with the new version of Symfony framework.

274492.4k](/packages/umpirsky-symfony-upgrade-fixer)[edgaras/strsim

Collection of string similarity and distance algorithms in PHP including Levenshtein, Damerau-Levenshtein, Jaro-Winkler, and more

2423.0k](/packages/edgaras-strsim)[webchemistry/forms-multiplier

Multiplier for nette forms

2860.9k](/packages/webchemistry-forms-multiplier)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
