Skip to content

Commit de7881f

Browse files
bobvandevijvertobias-93
authored andcommitted
Always specify PHP binary when running script
1 parent 4ae50fe commit de7881f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bin/composer-script/Script.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,9 @@ public static function runConsole(array $command): int
5151
*/
5252
public static function runPHP(array $command): int
5353
{
54-
// for windows systems add the interpreter
55-
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
56-
array_unshift($command, 'php');
57-
}
58-
54+
// Always add the interpreter to make sure scripts are run with the same php version
55+
array_unshift($command, PHP_BINARY);
56+
5957
if (version_compare(Composer::getVersion(), '2.3-dev', '<')) {
6058
// Composer 2.2.x or lower
6159
/* @phpstan-ignore-next-line */

0 commit comments

Comments
 (0)