All notable changes to phar-io/version are documented in this file using the Keep a CHANGELOG principles.
Changed
Version::getOriginalString() added (Thanks @addshore)^) now honor pre-1.0 releases, e.g. ^0.3 translates to 0.3.*)Version::equals() addedThis release now supports PHP 7.2+ and PHP ^8.0. No other changes included.
Potential BC Break Notice:
Version::getVersionString() no longer returns v prefixes in case the "input"
string contained one. These are not part of the semver specs
(see https://semver.org/#is-v123-a-semantic-version) and get stripped out.
As of Version 3.1.0 Version::getOriginalString() can be used to still
retrieve it as given.
3.0.0 > 3.0.0-alpha.1Changes to public API:
PreReleaseSuffix::construct(): optional parameter $number removedPreReleaseSuffix::isGreaterThan(): introducedVersion::hasPreReleaseSuffix(): introduceddevbeta (also abbreviated form b)rcalpha (also abbreviated form a)patch (also abbreviated form p)All values can be followed by a number, e.g. beta3.
When comparing versions, the pre-release suffix is taken into account. Example:
1.5.0 > 1.5.0-beta1 > 1.5.0-alpha3 > 1.5.0-alpha2 > 1.5.0-dev11