1--TEST--
2FPM: bug77780 - Headers already sent error incorrectly emitted
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--EXTENSIONS--
6session
7--FILE--
8<?php
9
10require_once "tester.inc";
11
12$cfg = <<<EOT
13[global]
14error_log = {{FILE:LOG}}
15[unconfined]
16listen = {{ADDR}}
17pm = static
18pm.max_children = 1
19EOT;
20
21$code = <<<EOT
22<?php
23echo str_repeat('asdfghjkl', 150000) . "\n";
24EOT;
25
26$tester = new FPM\Tester($cfg, $code);
27$tester->start(extensions: ['session']);
28$tester->expectLogStartNotices();
29$tester
30    ->request(
31        headers: [
32            'PHP_VALUE' => "session.cookie_secure=1",
33        ],
34        readLimit: 10,
35        expectError: true
36    );
37$tester->request(
38        headers: [
39            'PHP_VALUE' => "session.cookie_secure=1",
40        ]
41    )
42    ->expectNoError();
43$tester->terminate();
44$tester->close();
45
46?>
47Done
48--EXPECT--
49Done
50--CLEAN--
51<?php
52require_once "tester.inc";
53FPM\Tester::clean();
54?>
55