xref: /PHP-8.0/ext/session/tests/bug60634.phpt (revision 75a04eac)
1--TEST--
2Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write())
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    die("close: goodbye cruel world\n");
20}
21
22function read($id) {
23    return '';
24}
25
26function write($id, $session_data) {
27    die("write: goodbye cruel world\n");
28}
29
30function destroy($id) {
31    return true;
32}
33
34function gc($maxlifetime) {
35    return true;
36}
37
38session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc');
39session_start();
40session_write_close();
41echo "um, hi\n";
42
43?>
44--EXPECT--
45write: goodbye cruel world
46