vierbergenlars/php-semver
A PHP implementation of Semantic Versioning: parse, validate, compare, and sort SemVer version strings, and check them against constraints like ^1.2, ~2.0, or ranges. Lightweight, dependency-free, and ideal for package managers, release tooling, and update checks in any PHP project.
Accept header and routing to a compatible response shape/behavior, which buys you time before a breaking-change cutover.composer/semver: MIT, maintained by the Composer project, effectively already present in every PHP install, and the implementation the ecosystem tests against. It wins on license clarity, maintenance, and npm-semver parity for range syntax. For genuinely trivial cases, normalized version_compare() plus a strict format check is enough and adds zero dependencies.For executives: This is not a product bet — it's a small, replaceable utility that saves engineering from hand-writing version comparison. It unlocks concrete capabilities (plugin compatibility gating, upgrade prompts, API version routing) at roughly one to two days of integration cost, with no vendor lock-in and no ongoing spend. Two caveats to note rather than escalate: the upstream project is archived and the license isn't machine-identifiable, so if we adopt it we own the code from day one and should route the license past legal before it reaches a shipped artifact. Blast radius is contained by keeping it behind an internal interface.
For engineering: Pure PHP, no runtime dependencies, well-understood problem domain. Adopt it wrapped behind our own VersionConstraint interface so swapping to composer/semver is a single-file change. Pin the version and vendor it — there will be no upstream fixes. Recommended posture: use composer/semver for anything customer-facing or entitlement-related, and allow this package only in low-risk internal tooling where the archived status is an acceptable trade for a small footprint.
How can I help you explore Laravel packages today?