PHPackages                             version/version - 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. version/version

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

version/version
===============

A library for creating, editing, and comparing semantic versioning numbers.

2.4.0(6y ago)9662.7k↓16.9%26MITPHPPHP &gt;=5.3.3CI failing

Since Oct 18Pushed 6y ago3 watchersCompare

[ Source](https://github.com/php-mod/version)[ Packagist](https://packagist.org/packages/version/version)[ Docs](http://github.com/php-mod/version)[ RSS](/packages/version-version/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (8)Dependencies (2)Versions (10)Used By (6)

Versions and Constraints for PHP
================================

[](#versions-and-constraints-for-php)

This library parse versions, E.x.: `1.0.0``1.0.2-stable``1.0.20-alpha2`. It can parse constraints (like Composer versions), E.x.: `>=1.0 >=1.0,=1.0,=1.2`, `1.0.*`, `~1.2`.

The goal of that is to let you check if a version matches a constraint, or to check if a constraint is a subset of another constraint.

All that is done to let us select which version is compatible with a user constraints.

It works with the same rules of Composer versioning.

### Sorting

[](#sorting)

In order to use standard PHP sorting there is a helper class 'Compare' to use it with a sort you will need to do this;

```
use Version\Version;
use Version\Compare;

$vers = array();
$vers[] = Version::parse('1.1.1d1');
$vers[] = '1.1.1';

$obj = new Compare();
usort( $vers, array( $obj, 'compare' ) );
```

The above should allow any normal PHP sort to be instigated with very little effort.

**Note**: You should see that it will handle a string or a Version object as the variable to sort automatically.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~231 days

Recently: every ~405 days

Total

9

Last Release

2377d ago

Major Versions

1.0.0 → 2.0.02014-10-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/8da2a4376a9b330628e63e6d5b11ab407c17549b955b65adc19ca49b914e5fae?d=identicon)[amouhzi](/maintainers/amouhzi)

---

Top Contributors

[![amouhzi](https://avatars.githubusercontent.com/u/4458806?v=4)](https://github.com/amouhzi "amouhzi (40 commits)")

---

Tags

semanticversion

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/version-version/health.svg)

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

###  Alternatives

[wenzhixin/bootstrap-table

An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation)

11.8k283.4k1](/packages/wenzhixin-bootstrap-table)[nikolaposa/version

Value Object that represents a SemVer-compliant version number.

1406.4M16](/packages/nikolaposa-version)[shivas/versioning-bundle

Symfony application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

1121.2M1](/packages/shivas-versioning-bundle)[pragmarx/version

Take control over your Laravel app version

5921.2M2](/packages/pragmarx-version)[liip/rmt

Release Management Tool: a handy tool to help releasing new version of your software

457448.7k74](/packages/liip-rmt)[wolfcast/browser-detection

The Wolfcast BrowserDetection PHP class facilitates the identification of the user's environment such as Web browser, version, platform family, platform version or if it's a mobile device or not.

1391.0M7](/packages/wolfcast-browser-detection)

PHPackages © 2026

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