Skip to content

Semantic versioning string parsing and comparison library

License

Notifications You must be signed in to change notification settings

cubedtear/php-semver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cubedtear/semver

Simple PHP library to parse and compare Semantic Versioning versions.

Installation

Install the latest version with:

$ composer require cubedtear/semver

Requirements

  • PHP 8.1 is required but using the latest version of PHP is highly recommended.

Basic usage

use Cubedtear\Semver\Version;

$v1 = Version::parse("0.1.1");
$v2 = Version::parse("0.1.1-alpha");
$v3 = Version::parse("1.0.12-beta+ff12b4d8");

if (Version::compare($v1, $v2)) {
    ...
}

if (Version::compare("0.1.1", "0.1.0")) {
    ...
}

About

Semantic versioning string parsing and comparison library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages