xref: /PHP-5.6/ext/session/tests/bug60634.phpt (revision ae6e139c)
1--TEST--
2Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write())
3--INI--
4session.save_path=
5session.name=PHPSESSID
6--SKIPIF--
7<?php include('skipif.inc'); ?>
8--FILE--
9<?php
10
11ob_start();
12
13function open($save_path, $session_name) {
14    return true;
15}
16
17function close() {
18	die("close: goodbye cruel world\n");
19}
20
21function read($id) {
22	return '';
23}
24
25function write($id, $session_data) {
26	die("write: goodbye cruel world\n");
27}
28
29function destroy($id) {
30    return true;
31}
32
33function gc($maxlifetime) {
34    return true;
35}
36
37session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc');
38session_start();
39session_write_close();
40echo "um, hi\n";
41
42?>
43--EXPECTF--
44write: goodbye cruel world
45close: goodbye cruel world
46
47