Skip to content

List PHP versions that satisfy the given constraint

License

Notifications You must be signed in to change notification settings

typisttech/php-matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.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 --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"
    ],
    "lowest": "7.4.29",
    "highest": "8.1.31"
}

$ php-matrix --mode=minor-only  ">=7.2 <8.4"
{
    "constraint": ">=7.2 <8.4",
    "versions": [
        "7.2",
        "7.3",
        "7.4",
        "8.0",
        "8.1",
        "8.2",
        "8.3"
    ],
    "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.