[php-src] Issue #12385: `flush` with fastcgi does not force headers to be send
| From: | mvorisek | Date: | Sun, 08 Oct 2023 18:01:09 +0000 |
| Subject: | [php-src] Issue #12385: `flush` with fastcgi does not force headers to be send | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245518@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12385
Author: mvorisek
### Description
The following code:
```php
<?php
while (ob_get_level() !== 0) {
ob_end_flush();
}
flush();
var_dump(headers_sent());
var_dump(ob_get_level());
```
Resulted in this output:
```
bool(false)
int(0)
```
But I expected this output instead:
```
bool(true)
int(0)
```
This issue is reproducible with fastcgi on Windows together with nginx.
When I output/echo any data, the headers are always sent (expected).
When I use the php internal webserver instead, the
flush is enough to force the headers
to be send without any data/body (expected).
### PHP Version
8.1
### Operating System
Windows 10