---
title: "Discussion on \"Get Package Versions at Runtime with Composer 2\" | Hashnode"
description: "Discussion on \"Get Package Versions at Runtime with Composer 2\". Use Composer 2's InstalledVersions::getVersion() to check package versions at runtime for feature flags or compatibility — no lock file parsing required."
url: "https://hashnode.com/posts/php-third-package-version-1/69add9a5bc4378bf8e67b28d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Get Package Versions at Runtime with Composer 2](https://recca0120.hashnode.dev/php-third-package-version-1?utm_source=hashnode&utm_medium=feed)

Use Composer 2's InstalledVersions::getVersion() to check package versions at runtime for feature flags or compatibility — no lock file parsing required.

Mar 8 · 1 min read · recca0120.hashnode.dev  
Read the article

-   [#composer](https://hashnode.com/tag/composer)
-   [#php](https://hashnode.com/tag/php)

## Written by

[recca0120](https://hashnode.com/@recca0120)

@recca0120 · Taipei, Taiwan

  
[View profile](https://hashnode.com/@recca0120)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
