- What is sebastian/version used for in PHP projects?
- It manages version numbers for Git-hosted PHP projects. Given a release number and source path, it returns strings like 1.0.0-17-g00f3408 from git describe, or appends -dev when no release exists. It is intended for CLI tools and about screens that need build information.
- How do I install sebastian/version with Composer?
- Use composer require sebastian/version, or composer require --dev sebastian/version for development-only use. However, the package's composer.json requires PHP >=8.4, which no stable PHP release satisfies in current 8.2/8.3 environments. Installation may fail until that requirement and the release metadata are verified.
- Does sebastian/version work with Laravel?
- It is a generic PHP library, not a Laravel package. You could use it in Laravel CLI tools or about screens if dependencies allowed, but the PHP >=8.4 requirement blocks current Laravel environments. No feasible Laravel integration path exists until PHP 8.4 is available and the metadata is verified.
- Which PHP versions does sebastian/version require?
- The repository metadata lists PHP >=8.4. PHP 8.4 has not been released, while current stable versions are 8.2 and 8.3. That makes the requirement impossible to satisfy for active Laravel and PHP projects.
- Do I need to configure sebastian/version after installation?
- There is no configuration file. The constructor expects a release number and source path, and asString() is the only public method. In current PHP environments, the package's PHP >=8.4 requirement still blocks installation before configuration matters.
- Is sebastian/version maintained?
- The package has 6.5k stars but 0 direct dependents, and the last release date is listed as 2026-02-06. That date is in the future and suggests unverified or inaccurate release metadata. Maintenance status cannot be confirmed from the provided context, so treat adoption and release signals cautiously.
- Can I use sebastian/version in production?
- It is not usable in current PHP environments because composer.json requires PHP >=8.4. The core Git describe logic is simple, but the incompatibility and unverified metadata are production blockers. Do not rely on it in production until PHP 8.4 exists and the release metadata is confirmed.
- How does SebastianBergmann\Version::asString() generate version strings?
- If the path is not part of a Git repository and the release is X.Y.Z, asString() returns the release as-is. If the path is not in Git and the release is X.Y, it returns the release suffixed with -dev. If the path is in Git and the release is X.Y.Z, it returns git describe --tags output as-is. If the path is in Git and the release is X.Y, it returns a string starting with X.Y and ending with git describe --tags information.
- What are alternatives to sebastian/version for Laravel versioning?
- For Laravel apps, use Composer package versions, config('app.version'), or CI build metadata instead. If you specifically need git describe output, a small custom script or a maintained package can provide it. sebastian/version is not practical in current Laravel/PHP environments because of the PHP >=8.4 requirement.
- How do I test sebastian/version integration?
- You cannot install it under current PHP 8.2 or 8.3 because metadata requires PHP >=8.4. If the requirement changes, test in a disposable environment with the required PHP version. Cover both Git and non-Git paths and both X.Y.Z and X.Y release formats.