Skip to content

Commit

Permalink
[Process] Fix executable finder when the command starts with a dash
Browse files Browse the repository at this point in the history
  • Loading branch information
kayw-geek authored and nicolas-grekas committed Jan 11, 2024
1 parent 8fa2217 commit 9a2172b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PhpExecutableFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function find(bool $includeArgs = true)
{
if ($php = getenv('PHP_BINARY')) {
if (!is_executable($php)) {
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v';
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v --';
if ($php = strtok(exec($command.' '.escapeshellarg($php)), \PHP_EOL)) {
if (!is_executable($php)) {
return false;
Expand Down

0 comments on commit 9a2172b

Please sign in to comment.