phpro/grumphp
View on GitHubComposer plugin tasks not executed using the PHP version Composer is invoked with
Closed
#1170 opened on Apr 11, 2025
enhancementhelp wanted
Description
Given:
- two PHP versions installed side by side -
8.2and8.3 /usr/bin/phpinvokes PHP8.2(managed viaalternatives), so that's the default version- Composer is explicitly invoked with PHP
8.3, i.e./usr/bin/php8.3 ./composer.phar install
In this setup GrumPHP git:init and configure scripts are executed using PHP 8.2 because the plugin calls vendor/bin/grumphp directly instead of using the PHP binary Composer is using for the current invocation.
I'm not familiar with Composer Plugin API enough to tell if Composer exposes internally the PHP binary it was invoked with. However it looks like there is @php syntax for scripts that does something similar to what ${MAKE} would do in a Makefile, so Composer must maintain some sort of reference to the current PHP binary.