PHPackages                             typisttech/php-matrix - 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. [CLI &amp; Console](/categories/cli)
4. /
5. typisttech/php-matrix

ActiveProject[CLI &amp; Console](/categories/cli)

typisttech/php-matrix
=====================

List PHP versions that satisfy the required PHP constraint in composer.json.

v2.0.0(1w ago)18.4kMITPHPPHP ^8.5CI passing

Since Dec 14Pushed 1w agoCompare

[ Source](https://github.com/typisttech/php-matrix)[ Packagist](https://packagist.org/packages/typisttech/php-matrix)[ Docs](https://github.com/typisttech/php-matrix)[ Fund](https://typist.tech/donation/)[ GitHub Sponsors](https://github.com/tangrufus)[ RSS](/packages/typisttech-php-matrix/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (37)Versions (69)Used By (0)

PHP Matrix
==========

[](#php-matrix)

[![GitHub Release](https://camo.githubusercontent.com/68bc1ebe9743382fc4804b88921694b1663dffce145d592b0983d6ad8797389b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f747970697374746563682f7068702d6d6174726978)](https://github.com/typisttech/php-matrix/releases)[![Test](https://github.com/typisttech/php-matrix/actions/workflows/test.yml/badge.svg)](https://github.com/typisttech/php-matrix/actions/workflows/test.yml)[![codecov](https://camo.githubusercontent.com/770106f59635120a6544623dbd80b961ceb6e6abae61bd6fb5af89891143bc1b/68747470733a2f2f636f6465636f762e696f2f67682f747970697374746563682f7068702d6d61747269782f67726170682f62616467652e7376673f746f6b656e3d48563555444c504d4d51)](https://codecov.io/gh/typisttech/php-matrix)[![License](https://camo.githubusercontent.com/8915e4ebca38b1449fef30ddcd9dd240cdd603ce6f0f8aaa0feebf65cbe2a7c4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747970697374746563682f7068702d6d61747269782e737667)](https://github.com/typisttech/php-matrix/blob/master/LICENSE)[![Follow @TangRufus on X](https://camo.githubusercontent.com/7415ea9d2391e64fc2a35887d01d58c13cac70988c9ecc62b57bc7fee6104de5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466f6c6c6f772d54616e6752756675732d3135323032423f6c6f676f3d78266c6f676f436f6c6f723d7768697465)](https://x.com/tangrufus)[![Follow @TangRufus.com on Bluesky](https://camo.githubusercontent.com/6d838460816d5ab6e0e1f911a11f2731f12f3538761d12b8638f32861fcf2e1a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f426c7565736b792d54616e6752756675732e636f6d2d626c75653f6c6f676f3d626c7565736b79)](https://bsky.app/profile/tangrufus.com)[![Sponsor @TangRufus via GitHub](https://camo.githubusercontent.com/49753abc8cb53b971b0e46dec52e9ed32eaebf73be15ce3963306559a3ec7ccb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d54616e6752756675732d4541344141413f6c6f676f3d67697468756273706f6e736f7273)](https://github.com/sponsors/tangrufus)[![Hire Typist Tech](https://camo.githubusercontent.com/13f50b9bd2301613833b4f0ac55700b2f1c297c0fff7ba45a2a98b6c938a18db/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f486972652d547970697374253230546563682d373738383939)](https://typist.tech/contact/)

 **List PHP versions that satisfy the required PHP constraint in `composer.json`.**

 Built with ♥ by [Typist Tech](https://typist.tech/)

---

Tip

**Hire Tang Rufus!**

I am looking for my next role, freelance or full-time. If you find this tool useful, I can build you more weird stuff like this. Let's talk if you are hiring PHP / Ruby / Go developers.

Contact me at

---

GitHub Actions Usage
--------------------

[](#github-actions-usage)

For generating PHP version matrix in GitHub Actions, use [PHP Matrix Action](https://github.com/marketplace/actions/php-matrix).

Example```
name: Test

on:
  push:

jobs:
  php-matrix:
    runs-on: ubuntu-latest
    outputs:
      versions: ${{ steps.php-matrix.outputs.versions }}
    steps:
      - uses: actions/checkout@v7
        with:
          sparse-checkout: composer.json
          sparse-checkout-cone-mode: false

      - uses: typisttech/php-matrix-action@v3
        id: php-matrix

  test:
    runs-on: ubuntu-latest
    needs: php-matrix
    strategy:
      matrix:
        php-version: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
    steps:
      - uses: actions/checkout@v7
      - uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
      - run: composer install
      - run: composer test
```

CLI Usage
---------

[](#cli-usage)

### List PHP versions that satisfy the required PHP constraint in `composer.json`

[](#list-php-versions-that-satisfy-the-required-php-constraint-in-composerjson)

```
$ cat ./composer.json
{"require":{"php":"^7 || ^8"}}

$ php-matrix composer
{
    "constraint": "^7 || ^8",
    "versions": [
        "7.0",
        "7.1",
        "7.2",
        "7.3",
        "7.4",
        "8.0",
        "8.1",
        "8.2",
        "8.3",
        "8.4"
    ],
    "lowest": "7.0",
    "highest": "8.4"
}
```

```
$ cat ./some/path/to/the.json
{"require":{"php":"~7.4.29 || ~8.1.29"}}

$ php-matrix composer --source=php.net --mode=full ./some/path/to/the.json
{
    "constraint": "~7.4.29 || ~8.1.29",
    "versions": [
        "7.4.29",
        "7.4.30",
        "7.4.32",
        "7.4.33",
        "8.1.29",
        "8.1.30",
        "8.1.31",
        "8.1.32",
        "8.1.33"
    ],
    "lowest": "7.4.29",
    "highest": "8.1.33"
}
```

```
$ php-matrix composer --help
Description:
  List PHP versions that satisfy the required PHP constraint in composer.json

Usage:
  composer [options] [--] []

Arguments:
  path                  Path to composer.json file. [default: "./composer.json"]

Options:
      --source=SOURCE   Available sources:
                        - auto: Use offline in minor-only mode. Otherwise, fetch from php.net
                        - php.net: Fetch releases information from php.net
                        - offline: Use hardcoded releases information
                         [default: "auto"]
      --mode=MODE       Available modes:
                        - full: Report all satisfying versions in MAJOR.MINOR.PATCH format
                        - minor-only: Report MAJOR.MINOR versions only
                         [default: "minor-only"]
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
```

### List PHP versions that satisfy the given constraint

[](#list-php-versions-that-satisfy-the-given-constraint)

```
$ php-matrix constraint '^7 || ^8'
{
    "constraint": "^7 || ^8",
    "versions": [
        "7.0",
        "7.1",
        "7.2",
        "7.3",
        "7.4",
        "8.0",
        "8.1",
        "8.2",
        "8.3",
        "8.4"
    ],
    "lowest": "7.0",
    "highest": "8.4"
}
```

```
$ php-matrix constraint --source=php.net --mode=full '~7.4.29 || ~8.1.29'
{
    "constraint": "~7.4.29 || ~8.1.29",
    "versions": [
        "7.4.29",
        "7.4.30",
        "7.4.32",
        "7.4.33",
        "8.1.29",
        "8.1.30",
        "8.1.31",
        "8.1.32",
        "8.1.33"
    ],
    "lowest": "7.4.29",
    "highest": "8.1.33"
}
```

```
$ php-matrix constraint --help
Description:
  List PHP versions that satisfy the given constraint

Usage:
  constraint [options] [--]

Arguments:
  constraint            The version constraint.

Options:
      --source=SOURCE   Available sources:
                        - auto: Use offline in minor-only mode. Otherwise, fetch from php.net
                        - php.net: Fetch releases information from php.net
                        - offline: Use hardcoded releases information
                         [default: "auto"]
      --mode=MODE       Available modes:
                        - full: Report all satisfying versions in MAJOR.MINOR.PATCH format
                        - minor-only: Report MAJOR.MINOR versions only
                         [default: "minor-only"]
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
```

### Options

[](#options)

#### `--mode`

[](#--mode)

Available modes:

- `minor-only` *(default)*: Report `MAJOR.MINOR` versions only
- `full`: Report all satisfying versions in `MAJOR.MINOR.PATCH` format

#### `--source`

[](#--source)

Available sources:

- `auto` *(default)*: Use `offline` in `minor-only` mode. Otherwise, fetch from [php.net](https://www.php.net/releases/index.php)
- `php.net`: Fetch releases information from [php.net](https://www.php.net/releases/index.php)
- `offline`: Use [hardcoded releases](./data/all-versions.json) information

Tip

**Hire Tang Rufus!**

There is no need to understand any of these quirks. Let me handle them for you. I am seeking my next job, freelance or full-time.

If you are hiring PHP / Ruby / Go developers, contact me at

### Dump Shell Completion Scripts

[](#dump-shell-completion-scripts)

For shell completions, follow the instructions from:

```
$ php-matrix completion --help
```

If you installed `PHP Matrix` [via Homebrew](#homebrew-macos--linux-recommended), completion scripts are managed by Homebrew. Read more at

Installation
------------

[](#installation)

### Homebrew (macOS / Linux) (Recommended)

[](#homebrew-macos--linux-recommended)

```
brew install typisttech/tap/php-matrix
```

### Linux (Debian &amp; Alpine)

[](#linux-debian--alpine)

Follow the instructions on

[![Cloudsmith](https://camo.githubusercontent.com/17a5cd10435ee362ed8b699e5a5998373455e86ae2197052c139514468c272a7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4f5353253230686f7374696e6725323062792d636c6f7564736d6974682d626c75653f6c6f676f3d636c6f7564736d697468267374796c653d666c61742d737175617265266c696e6b3d6874747073253341253246253246636c6f7564736d6974682e636f6d)](https://camo.githubusercontent.com/17a5cd10435ee362ed8b699e5a5998373455e86ae2197052c139514468c272a7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4f5353253230686f7374696e6725323062792d636c6f7564736d6974682d626c75653f6c6f676f3d636c6f7564736d697468267374796c653d666c61742d737175617265266c696e6b3d6874747073253341253246253246636c6f7564736d6974682e636f6d)

Package repository hosting is graciously provided by [Cloudsmith](https://cloudsmith.com). Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that enables your organization to create, store and share packages in any format, to any place, with total confidence.

### Pre-built `.deb` &amp; `.apk`

[](#pre-built-deb--apk)

Warning

If you install the `.deb` or `.apk` file manually, you have to updating them manually.

Download the latest `.deb` or `.apk` file from [GitHub Releases](https://github.com/typisttech/php-matrix/releases/latest), or via [`gh`](https://cli.github.com/).

Then, install it via `dpkg -install` or `apk add`.

### Pre-built Binaries

[](#pre-built-binaries)

Warning

If you install the binaries manually, you have to updating them manually.

Download the latest `.tar.gz` file from [GitHub Releases](https://github.com/typisttech/php-matrix/releases/latest), or via [`gh`](https://cli.github.com/).

Then, unarchive and move the binary into `$PATH`.

People Also Use
---------------

[](#people-also-use)

- [PHP Matrix Action](https://github.com/typisttech/php-matrix-action)Generate PHP version matrix according to `composer.json` for GitHub Actions
- [Composer Audit to SARIF Action](https://github.com/typisttech/composer-audit-to-sarif-action)Convert Composer audit reports to SARIF files in GitHub Actions
- [WP Sec Adv](https://github.com/typisttech/wpsecadv)Composer repository for WordPress security advisories
- [WP Org Closed Plugin](https://github.com/typisttech/wp-org-closed-plugin)Composer plugin to mark packages as abandoned if closed on WordPress.org

Credits
-------

[](#credits)

[`PHP Matrix`](https://github.com/typisttech/php-matrix) is a [Typist Tech](https://typist.tech) project and maintained by [Tang Rufus](https://x.com/TangRufus), freelance developer [for hire](https://typist.tech/contact/).

Full list of contributors can be found [on GitHub](https://github.com/typisttech/php-matrix/graphs/contributors).

Copyright and License
---------------------

[](#copyright-and-license)

This project is a [free software](https://www.gnu.org/philosophy/free-sw.en.html) distributed under the terms of the MIT license. For the full license, see [LICENSE](./LICENSE).

Contribute
----------

[](#contribute)

Feedbacks / bug reports / pull requests are welcome.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance94

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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

Every ~18 days

Recently: every ~13 days

Total

31

Last Release

12d ago

Major Versions

v0.2.7 → v1.0.02025-10-15

v1.1.6 → v2.0.02026-06-21

PHP version history (2 changes)v0.1.0PHP ^8.4

v1.1.0PHP ^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/c1b05c8ed4ea3f68173555264d0226d5faeb7f315ed9df91890c351ef576ce72?d=identicon)[TangRufus](/maintainers/TangRufus)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (111 commits)")[![tangrufus](https://avatars.githubusercontent.com/u/2259834?v=4)](https://github.com/tangrufus "tangrufus (85 commits)")[![tastendruck[bot]](https://avatars.githubusercontent.com/u/25708257?v=4)](https://github.com/tastendruck[bot] "tastendruck[bot] (25 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (1 commits)")

---

Tags

clicomposerphpversionphpcomposercliversion

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/typisttech-php-matrix/health.svg)

```
[![Health](https://phpackages.com/badges/typisttech-php-matrix/health.svg)](https://phpackages.com/packages/typisttech-php-matrix)
```

###  Alternatives

[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[drush/drush

Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.

2.4k60.6M803](/packages/drush-drush)

PHPackages © 2026

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