8000 Fix Inconsistent Exit Status in `proc_get_status` for PHP Versions Below 8.3 by Luc45 · Pull Request #53820 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix Inconsistent Exit Status in proc_get_status for PHP Versions Below 8.3 #53820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Code style
  • Loading branch information
Luc45 authored Feb 7, 2024
commit 144796f3f11a5c8000857da567d7ec78d946dc95
6 changes: 3 additions & 3 deletions src/Symfony/Component/Process/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -1292,9 +1292,9 @@ protected function updateStatus(bool $blocking): void

$running = $this->processInformation['running'];

// In PHP < 8.3, "proc_get_status" only returns the correct exit status on the first call.
// Subsequent calls return -1 as the process is discarded. This workaround caches the first
// retrieved exit status for consistent results in later calls, mimicking PHP 8.3 behavior.
// In PHP < 8.3, "proc_get_status" only returns the correct exit status on the first call.
// Subsequent calls return -1 as the process is discarded. This workaround caches the first
// retrieved exit status for consistent results in later calls, mimicking PHP 8.3 behavior.
if (version_compare(\PHP_VERSION, '8.3.0', '<')) {
static $cachedExitCode = null;

Expand Down
0