Issue: https://github.com/php/php-src/issues/7769
Author: gnif
### Description
The following code:
```php
<?PHP
$pid = pcntl_fork();
if ($pid)
{
echo "PID: $pid\n";
exit(0);
}
fclose(STDOUT);
fclose(STDERR);
posix_setsid();
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1);
socket_bind($socket, 0, 1234);
socket_listen($socket);
$client = socket_accept($socket);
for(;;)
{
$line = socket_read($client, 1024, PHP_NORMAL_READ);
if ($line === false)
break;
exec("echo This is sent out the socket >&2");
}
socket_close($client);
socket_close($socket);
?>
```
When connecting over a socket to the host on port 1234 (via telnet) resulted in this
output:
```
> asdf
< This is sent out the socket
< This is sent out the socket
```
But I expected no output at all on the socket.
Note I am not sure if this is caused by misuse by closing STDOUT & STDERR but it seems like this
is incorrect behaviour.
### PHP Version
PHP 8.0.13
### Operating System
_No response_