xref: /PHP-8.0/ext/session/tests/bug61728.phpt (revision 7aacc705)
1--TEST--
2Bug #61728 (PHP crash when calling ob_start in request_shutdown phase)
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--FILE--
6<?php
7function output_html($ext) {
8    return strlen($ext);
9}
10
11function open ($save_path, $session_name) {
12    return true;
13}
14
15function close() {
16    return true;
17}
18
19function read ($id) {
20    return '';
21}
22
23function write ($id, $sess_data) {
24    ob_start("output_html");
25    echo "laruence";
26    ob_end_flush();
27    return true;
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();
40?>
41--EXPECT--
428
43