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