[php-src] Issue #8609: The output before the header does not report an error?
| From: | 104979058 | Date: | Mon, 23 May 2022 01:46:21 +0000 |
| Subject: | [php-src] Issue #8609: The output before the header does not report an error? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241575@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8609
Author: 104979058
### Description
The following code:
```php
<?php
/* This will give an error. Note the output
* above, which is before the header() call */
// https://www.php.net/manual/en/function.header.php
echo 'test111';
header('Location: http://www.example.com/');
exit;
?>
```
Resulted in this output:
```
test111
```
But I expected this output instead:
```
Error: Cannot modify header information - headers already sent
```
### PHP Version
8.1.6
### Operating System
windows