PHPackages                             gordonlesti/longest-common-subsequence - 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. gordonlesti/longest-common-subsequence

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

gordonlesti/longest-common-subsequence
======================================

v1.0.0(6y ago)121MITPHPPHP &gt;=7.0CI failing

Since Oct 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/GordonLesti/LongestCommonSubsequence)[ Packagist](https://packagist.org/packages/gordonlesti/longest-common-subsequence)[ RSS](/packages/gordonlesti-longest-common-subsequence/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

LongestCommonSubsequence
========================

[](#longestcommonsubsequence)

[![Latest Version on Packagist](https://camo.githubusercontent.com/efc3307a9a7ebf77ce359c8fa62ee016c23782fd5ef6939a4665ae094eba3a61/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f72646f6e6c657374692f6c6f6e676573742d636f6d6d6f6e2d73756273657175656e63652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gordonlesti/longest-common-subsequence)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/9c12062e294becd0fbb365e94d46fde23e0051ef602473f44883d403662ab302/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f476f72646f6e4c657374692f4c6f6e67657374436f6d6d6f6e53756273657175656e63652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/GordonLesti/LongestCommonSubsequence)[![Coverage Status](https://camo.githubusercontent.com/613ed1672acde2a010fa6bbb6b55ae9d71d7916ab42f429237ca9d0465fb627e/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f476f72646f6e4c657374692f4c6f6e67657374436f6d6d6f6e53756273657175656e63652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/GordonLesti/LongestCommonSubsequence?branch=master)[![Total Downloads](https://camo.githubusercontent.com/80659bec6ca4e539645ca1a089a46fbde122490acbd3705f0ac3343aa07c6259/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f72646f6e6c657374692f6c6f6e676573742d636f6d6d6f6e2d73756273657175656e63652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gordonlesti/longest-common-subsequence)

PHP Implementation of Longest common subsequence algorithm that works with UTF-8 input.

Install
-------

[](#install)

Via Composer

```
$ composer require gordonlesti/longest-common-subsequence
```

Usage
-----

[](#usage)

```
use GordonLesti\LongestCommonSubsequence\LongestCommonSubsequence;
```

Calculates the longest common subsequence of both strings and returns the length.

```
$lcsDist = LongestCommonSubsequence::lcs("DABDC", "CBDBBAC");
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Gordon Lesti](https://gordonlesti.com)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community5

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

2396d ago

### Community

---

Top Contributors

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

---

Tags

longest-common-subsequencephp

### Embed Badge

![Health badge](/badges/gordonlesti-longest-common-subsequence/health.svg)

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

###  Alternatives

[aimeos/aimeos-base

Aimeos base layer for abstracting from host environments

2.1k134.0k1](/packages/aimeos-aimeos-base)[microweber/screen

A PHP Class to interact with PhantomJs and capture screenshot of a webpage

632226.0k1](/packages/microweber-screen)[fuel/docs

FuelPHP 1.x Documenataion

166542.3k4](/packages/fuel-docs)[php-soap/ext-soap-engine

An ext-soap engine implementation

443.2M7](/packages/php-soap-ext-soap-engine)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

38244.6k16](/packages/ec-europa-toolkit)[fof/user-directory

The permission based public user directory extension for your Flarum forum.

2789.7k5](/packages/fof-user-directory)

PHPackages © 2026

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