typisttech/php-matrix

List PHP versions that satisfy the given constraint.

Fund package maintenance!
tangrufus
typist.tech/donation

Installs: 1 155

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

Type:project

v0.1.1 2024-12-18 21:41 UTC

README

PHP Matrix

Packagist Version PHP Version Require Test codecov License Follow @TangRufus on X Follow @TangRufus.com on Bluesky Sponsor @TangRufus via GitHub Hire Typist Tech

List PHP versions that satisfy the given constraint.

Built with ♥ by Typist Tech

Usage

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

$ php-matrix --mode=full  "~7.4.29 || ~8.1.29"
{
    "constraint": "~7.4.29 || ~8.1.29",
    "versions": [
        "7.4.33",
        "7.4.32",
        "7.4.30",
        "7.4.29",
        "8.1.31",
        "8.1.30",
        "8.1.29"
    ],
    "lowest": "7.4.29",
    "highest": "8.1.31"
}

$ php-matrix --mode=minor-only  ">=7.2 <8.4"
{
    "constraint": ">=7.2 <8.4",
    "versions": [
        "7.4",
        "7.3",
        "7.2",
        "8.3",
        "8.2",
        "8.1",
        "8.0"
    ],
    "lowest": "7.2",
    "highest": "8.3"
}

Options

--mode

Available modes:

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

--source

Available sources:

  • auto (default): Use offline in minor-only mode. Otherwise, fetch from php.net
  • php.net: Fetch releases information from php.net
  • offline: Use hardcoded releases information

Installation

Composer Global

composer global require typisttech/php-matrix
php-matrix --help

Composer Project

composer create-project typisttech/php-matrix
cd php-matrix
./bin/php-matrix --help

Credits

PHP Matrix is a Typist Tech project and maintained by Tang Rufus, freelance developer for hire.

Full list of contributors can be found on GitHub.

Copyright and License

This project is a free software distributed under the terms of the MIT license. For the full license, see LICENSE.

Contribute

Feedbacks / bug reports / pull requests are welcome.