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);