[php-src] Issue #10239: proc_close after proc_get_status always returns -1

From: Date: Fri, 06 Jan 2023 11:05:14 +0000
Subject: [php-src] Issue #10239: proc_close after proc_get_status always returns -1
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-243357@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/10239
Author: pezcurrel

### Description

The following code:

```
<?php
$p = proc_open('sleep 1', array(), $foo);
do {
    usleep(100000);
    $s = proc_get_status($p);
    echo $s['running'] ? 'Running' : 'Finished', PHP_EOL;
} while ($s['running']);
$q = proc_open('sleep 3600', array(), $foo);
echo proc_close($p), PHP_EOL;
```

Resulted in this output:
```
Running
Running
Running
...
Finished
0
```

But I expected this output instead:
```
Running
Running
Running
...
Finished
-1
```

### PHP Version

PHP 8.1.13

### Operating System

Arch Linux


Thread (1 message)

  • pezcurrel
« previous php.bugs (#243357) next »