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