File tree 2 files changed +6
-15
lines changed
2 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,6 @@ class Process implements \IteratorAggregate
80
80
private WindowsPipes |UnixPipes $ processPipes ;
81
81
82
82
private ?int $ latestSignal = null ;
83
- private ?int $ cachedExitCode = null ;
84
83
85
84
private static ?bool $ sigchild = null ;
86
85
@@ -1289,21 +1288,10 @@ protected function updateStatus(bool $blocking)
1289
1288
return ;
1290
1289
}
1291
1290
1292
- $ this ->processInformation = proc_get_status ($ this ->process );
1293
- $ running = $ this ->processInformation ['running ' ];
1294
-
1295
- // In PHP < 8.3, "proc_get_status" only returns the correct exit status on the first call.
1296
- // Subsequent calls return -1 as the process is discarded. This workaround caches the first
1297
- // retrieved exit status for consistent results in later calls, mimicking PHP 8.3 behavior.
1298
- if (\PHP_VERSION_ID < 80300 ) {
1299
- if (!isset ($ this ->cachedExitCode ) && !$ running && -1 !== $ this ->processInformation ['exitcode ' ]) {
1300
- $ this ->cachedExitCode = $ this ->processInformation ['exitcode ' ];
1301
- }
1302
-
1303
- if (isset ($ this ->cachedExitCode ) && !$ running && -1 === $ this ->processInformation ['exitcode ' ]) {
1304
- $ this ->processInformation ['exitcode ' ] = $ this ->cachedExitCode ;
1305
- }
1291
+ if ($ this ->processInformation ['running ' ] ?? true ) {
1292
+ $ this ->processInformation = proc_get_status ($ this ->process );
1306
1293
}
1294
+ $ running = $ this ->processInformation ['running ' ];
1307
1295
1308
1296
$ this ->readPipes ($ running && $ blocking , '\\' !== \DIRECTORY_SEPARATOR || !$ running );
1309
1297
Original file line number Diff line number Diff line change @@ -711,6 +711,9 @@ public function testProcessIsSignaledIfStopped()
711
711
if ('\\' === \DIRECTORY_SEPARATOR ) {
712
712
$ this ->markTestSkipped ('Windows does not support POSIX signals ' );
713
713
}
714
+ if (\PHP_VERSION_ID < 80300 && isset ($ _SERVER ['GITHUB_ACTIONS ' ])) {
715
+ $ this ->markTestSkipped ('Transient on GHA with PHP < 8.3 ' );
716
+ }
714
717
715
718
$ process = $ this ->getProcessForCode ('sleep(32); ' );
716
719
$ process ->start ();
You can’t perform that action at this time.
0 commit comments