1--TEST--
2Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write after exec
3--INI--
4session.save_path=
5session.name=PHPSESSID
6session.save_handler=files
7--EXTENSIONS--
8session
9--FILE--
10<?php
11
12ob_start();
13
14function open($save_path, $session_name) {
15    return true;
16}
17function close() {
18    echo "close: goodbye cruel world\n";
19    exit;
20}
21function read($id) {
22    return '';
23}
24function write($id, $session_data) {
25    echo "write: goodbye cruel world\n";
26    throw new Exception;
27}
28function destroy($id) {
29    return true;
30}
31function gc($maxlifetime) {
32    return true;
33}
34session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc');
35
36session_start();
37
38?>
39--EXPECTF--
40Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
41write: goodbye cruel world
42
43Fatal error: Uncaught Exception in %s
44Stack trace:
45#0 [internal function]: write('%s', '')
46#1 {main}
47  thrown in %s on line %d
48
49Warning: PHP Request Shutdown: Cannot call session save handler in a recursive manner in Unknown on line 0
50