-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Description
The following code:
<?php
ob_start();
session_set_save_handler(
function ($savePath, $sessionName) {
var_dump("open");
return true;
},
function () {
var_dump("close");
return true;
},
function ($id) {
var_dump("read");
return '';
},
function ($id, $data) {
var_dump("write");
return true;
},
function ($id) {
var_dump("destroy");
return true;
},
function ($maxlifetime) {
var_dump("gc");
return true;
},
function () {
var_dump("create_sid");
return 'foo';
}
);
session_set_save_handler(
function ($savePath, $sessionName) {
var_dump("open");
return true;
},
function () {
var_dump("close");
return true;
},
function ($id) {
var_dump("read");
return '';
},
function ($id, $data) {
var_dump("write");
return true;
},
function ($id) {
var_dump("destroy");
return true;
},
function ($maxlifetime) {
var_dump("gc");
return true;
},
);
session_start();Resulted in this output:
string(4) "open"
string(10) "create_sid"
string(4) "read"
string(5) "write"
string(5) "close"
But I expected this output instead:
string(4) "open"
string(4) "read"
string(5) "write"
string(5) "close"
PHP Version
PHP 8.4.17 (cli) (built: Jan 18 2026 14:19:44) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.4.17, Copyright (c) Zend Technologies
with Zend OPcache v8.4.17, Copyright (c), by Zend Technologies
Operating System
No response
Reactions are currently unavailable