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

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

phar-io/version
===============

Library for handling version information and constraints

3.2.1(4y ago)7.5k743.4M—8.1%18[3 issues](https://github.com/phar-io/version/issues)[1 PRs](https://github.com/phar-io/version/pulls)20BSD-3-ClausePHPPHP ^7.2 || ^8.0

Since Mar 3Pushed 2y ago3 watchersCompare

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

READMEChangelog (9)DependenciesVersions (15)Used By (20)

Version
=======

[](#version)

Library for handling version information and constraints

[![CI](https://github.com/phar-io/version/actions/workflows/ci.yml/badge.svg)](https://github.com/phar-io/version/actions/workflows/ci.yml)

Installation
------------

[](#installation)

You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):

```
composer require phar-io/version

```

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

```
composer require --dev phar-io/version

```

Version constraints
-------------------

[](#version-constraints)

A Version constraint describes a range of versions or a discrete version number. The format of version numbers follows the schema of [semantic versioning](http://semver.org): `..`. A constraint might contain an operator that describes the range.

Beside the typical mathematical operators like `=`, there are two special operators:

*Caret operator*: `^1.0`can be written as `>=1.0.0 =1.0.0 parse( '^7.0' );

$caret_constraint->complies( new Version( '7.0.17' ) ); // true
$caret_constraint->complies( new Version( '7.1.0' ) ); // true
$caret_constraint->complies( new Version( '6.4.34' ) ); // false

$tilde_constraint = $parser->parse( '~1.1.0' );

$tilde_constraint->complies( new Version( '1.1.4' ) ); // true
$tilde_constraint->complies( new Version( '1.2.0' ) ); // false
```

As of version 2.0.0, pre-release labels are supported and taken into account when comparing versions:

```
$leftVersion = new PharIo\Version\Version('3.0.0-alpha.1');
$rightVersion = new PharIo\Version\Version('3.0.0-alpha.2');

$leftVersion->isGreaterThan($rightVersion); // false
$rightVersion->isGreaterThan($leftVersion); // true
```

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity83

Widely adopted with strong download metrics

Community36

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 60.2% 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 ~151 days

Recently: every ~108 days

Total

13

Last Release

1548d ago

Major Versions

1.0.1 → 2.0.02018-06-23

2.0.1 → 3.0.02020-05-05

PHP version history (3 changes)1.0.0PHP ^5.6 || ^7.0

3.0.0PHP ^7.2

3.0.2PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1089?v=4)[Sebastian Probst Eide](/maintainers/sebastian)[@sebastian](https://github.com/sebastian)

![](https://www.gravatar.com/avatar/0fc8fe1ac311fb26137cc3b26cd6c1bbb58c9ac4f287eb9d8242a741cef9a502?d=identicon)[theseer](/maintainers/theseer)

---

Top Contributors

[![theseer](https://avatars.githubusercontent.com/u/111333?v=4)](https://github.com/theseer "theseer (62 commits)")[![sebastianheuer](https://avatars.githubusercontent.com/u/169095?v=4)](https://github.com/sebastianheuer "sebastianheuer (19 commits)")[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (9 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (3 commits)")[![Ayesh](https://avatars.githubusercontent.com/u/811553?v=4)](https://github.com/Ayesh "Ayesh (2 commits)")[![exussum12](https://avatars.githubusercontent.com/u/1102850?v=4)](https://github.com/exussum12 "exussum12 (2 commits)")[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (1 commits)")[![dnaber-de](https://avatars.githubusercontent.com/u/1133205?v=4)](https://github.com/dnaber-de "dnaber-de (1 commits)")[![GuillaumeSeren](https://avatars.githubusercontent.com/u/767331?v=4)](https://github.com/GuillaumeSeren "GuillaumeSeren (1 commits)")[![j-d](https://avatars.githubusercontent.com/u/1140726?v=4)](https://github.com/j-d "j-d (1 commits)")[![llaville](https://avatars.githubusercontent.com/u/364342?v=4)](https://github.com/llaville "llaville (1 commits)")[![addshore](https://avatars.githubusercontent.com/u/3308769?v=4)](https://github.com/addshore "addshore (1 commits)")

### Embed Badge

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

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

###  Alternatives

[phinq/phinq

A library for querying data and performing statistical operations in an logical, object-oriented fashion.

108.8k](/packages/phinq-phinq)

PHPackages © 2026

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