1--TEST--
2Throwing output buffer with exit("Message")
3--FILE--
4<?php
5
6ob_start(function ($text) {
7    fwrite(STDOUT, "Handler: " . $text);
8    throw new Exception('test');
9}, chunk_size: 10);
10
11try {
12    exit("Hello world!\n");
13} catch (Throwable $e) {
14    echo $e::class, ': ', $e->getMessage(), PHP_EOL;
15}
16echo "After?\n";
17
18?>
19--EXPECT--
20Handler: Hello world!
21Hello world!
22Exception: test
23After?
24