xref: /PHP-8.1/ext/session/tests/bug60634.phpt (revision b5a14e6c)
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--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    die("close: goodbye cruel world\n");
22}
23
24function read($id) {
25    return '';
26}
27
28function write($id, $session_data) {
29    die("write: goodbye cruel world\n");
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?>
46--EXPECT--
47write: goodbye cruel world
48