Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  [skip ci] Fix valgrind benchmark diff output
This commit is contained in:
Ilija Tovilo 2025-03-30 00:45:03 +01:00
commit 20324388a4
No known key found for this signature in database
GPG key ID: 5050C66BFCD1015A
2 changed files with 9 additions and 3 deletions

View file

@ -73,7 +73,11 @@ function find_benchmarked_commit_hash(string $repo, string $commitHash): ?string
if (file_exists($summaryFile)) {
break;
}
$commitHash = trim(runCommand(['git', 'rev-parse', $commitHash . '^'], dirname(__DIR__))->stdout);
$commitHash = trim(runCommand(
['git', 'rev-parse', $commitHash . '^'],
dirname(__DIR__),
printCommand: false,
)->stdout);
}
return $commitHash;

View file

@ -5,12 +5,14 @@ class ProcessResult {
public $stderr;
}
function runCommand(array $args, ?string $cwd = null): ProcessResult {
function runCommand(array $args, ?string $cwd = null, bool $printCommand = true): ProcessResult {
$cmd = implode(' ', array_map('escapeshellarg', $args));
$pipes = null;
$result = new ProcessResult();
$descriptorSpec = [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']];
fwrite(STDOUT, "> $cmd\n");
if ($printCommand) {
fwrite(STDOUT, "> $cmd\n");
}
$processHandle = proc_open($cmd, $descriptorSpec, $pipes, $cwd ?? getcwd(), null);
$stdin = $pipes[0];