phlak/semver
Semantic versioning helper library
6.1.1
1.8M downloads/mo
#4233 most downloaded on Packagist
PHLAK/SemVer
What this package is like to depend on
Last release 1 years ago
14 Jun 2025
Release timing varies
gaps range from 4 weeks to 2.2 years
Some releases are documented
notes for 10 of 19 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
19 releases · first in 2016
0 releases in the last 12 months
see the full history below
Release timeline
19 releases · Jun 2016 to Jun 2025Releases
latest 19-
6.1.114 Jun 2025 -
6.1.011 Dec 2024 -
6.0.019 Sep 2024Release notes
Open source →Added
- Add ability to compare versions major, minor or patch versions only (#35 - Thanks @MuhmdRaouf!)
Changed
- Minimum supported PHP version is now 8.1
-
5.0.002 Aug 2024Release notes
Open source →Added
- Added
isPreRelease()method - Added
hasBuild()method
Changed
- Minimum supported PHP version is now 8.0
- Make
Versionclass JSON serializable (#33 - Thanks @joint-tech!) - Make
Versionclass inheritable (#34 - Thanks @joint-tech!)
Fixed
- Fixed
preReleasesometimes ending up as an empty string
- Added
-
4.1.023 Dec 2022 -
4.0.025 Aug 2021Release notes
Open source →Added
- Added
SemVer::compare()method
Removed
- Dropped support for PHP 7.1
Detailed changelog: 3.2.0...4.0.0
- Added
-
3.2.010 Apr 2020Release notes
Open source →Added
- Added
Version::parse()static constructor for parsing incomplete version strings (#11)
Fixed
- Fixed improper string conversion when initialized with a build but no pre-release
Detailed changelog: 3.1.0...3.2.0
- Added
-
3.1.016 Mar 2020Release notes
Open source →Changed
- Enforce minimum PHP version to >=7.1
- Miscellaneous internal cleanup/optimizations
Detailed changelog: 3.0.1...3.1.0
-
3.0.103 Feb 2020 -
3.0.003 Dec 2019Release notes
Open source →Added
- Added a
semver()helper method
Changed
- Implemented the magic
__toString()method allowing aVersionobject it to be cast to a string (e.g.(string) $semver) - Pre-release tags are now evaluated during comparisons (e.g.
Version::gt(),Version::lt(), etc.)
Removed
- Removed
Version::toString()method (see above for casting to string)
Fixed
- Build number would not be unset when setting the major/minor/patch version
- Pre-release and build properties are no longer case-sensitive
Detailed changelog: 2.0.1...3.0.0
- Added a
-
2.0.107 Sep 2017Nothing published for this version
-
1.0.006 Sep 2017Nothing published for this version
-
0.2.011 Sep 2016Nothing published for this version
-
0.1.503 Sep 2016Nothing published for this version
-
0.1.403 Sep 2016Nothing published for this version
-
0.1.325 Jun 2016Nothing published for this version
-
0.1.224 Jun 2016Nothing published for this version
-
0.1.124 Jun 2016Nothing published for this version
-
0.1.024 Jun 2016Nothing published for this version