PHPackages                             jeffpacks/semver - 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. jeffpacks/semver

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

jeffpacks/semver
================

A simple implementation of a SemVer 2.0.0 semi-compliant version number

3.8.0(2y ago)16.8k↓50%MITPHPPHP ^7.4|^8.0|^8.1

Since Mar 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jeffpacks/semver)[ Packagist](https://packagist.org/packages/jeffpacks/semver)[ Docs](https://github.com/jeffpacks/semver)[ RSS](/packages/jeffpacks-semver/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (17)Used By (0)

About
=====

[](#about)

The `VersionNumber` class of this library represents a [SemVer 2.0.0](https://semver.org/) semi-compliant version number. The class offers methods for querying the version number it represents as well as methods for comparison and manipulation.

The `VersionRange` class represents a range a version number falls inside or outside of. It currently only offers caret range support.

Requirements
============

[](#requirements)

This library requires PHP 7.4/8.0 and jeffpacks/substractor.

Installing
==========

[](#installing)

Run `composer require jeffpacks/semver` in your project's root directory and `use \jeffpacks\semver\VersionNumber` in your PHP script/class.

If you don't want to use Composer or its classloader and have downloaded this library, you may use the built-in classloader instead:

```
