From c0b8086af52c6d845411ea9922011824a961b75c Mon Sep 17 00:00:00 2001 From: Michael Newton Date: Fri, 1 Mar 2024 02:14:41 -0700 Subject: [PATCH] Include PHP information when showing Composer version verbosely (#11866) Co-authored-by: Jordi Boggiano --- src/Composer/Console/Application.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 709ce6ef8..bf23b2d79 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -383,6 +383,11 @@ class Application extends BaseApplication $result = parent::doRun($input, $output); + if (true === $input->hasParameterOption(['--version', '-V'], true)) { + $io->writeError(sprintf('PHP version %s (%s)', \PHP_VERSION, \PHP_BINARY)); + $io->writeError('Run the "diagnose" command to get more detailed diagnostics output.'); + } + // chdir back to $oldWorkingDir if set if (isset($oldWorkingDir) && '' !== $oldWorkingDir) { Silencer::call('chdir', $oldWorkingDir);