1--TEST--
2Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in close during exec
3--INI--
4session.save_path=
5session.name=PHPSESSID
6session.save_handler=files
7--EXTENSIONS--
8session
9--FILE--
10<?php
11
12ob_start();
13
14class MySessionHandler implements SessionHandlerInterface {
15    function open($save_path, $session_name): bool {
16        return true;
17    }
18
19    function close(): bool {
20        echo "close: goodbye cruel world\n";
21        undefined_function();
22    }
23
24    function read($id): string {
25        return '';
26    }
27
28    function write($id, $session_data): bool {
29        return true;
30    }
31
32    function destroy($id): bool {
33        return true;
34    }
35
36    function gc($maxlifetime): int {
37        return 1;
38    }
39}
40
41session_set_save_handler(new MySessionHandler());
42session_start();
43session_write_close();
44echo "um, hi\n";
45
46?>
47--EXPECTF--
48close: goodbye cruel world
49
50Fatal error: Uncaught Error: Call to undefined function undefined_function() in %s:%d
51Stack trace:
52#0 [internal function]: MySessionHandler->close()
53#1 %s(%d): session_write_close()
54#2 {main}
55  thrown in %s on line %d
56