1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 14:01:01 +02:00
Files
archived-php-src/ext/session/tests/bug80889a.phpt
Christoph M. Becker 838951c2d6 Fix #80889: amendment
`session_set_save_handler()` may be called with callables instead of an
object; we need to cater to that as well.

We also extract a set_user_save_handler_ini() function to avoid code
duplication.

Closes GH-6796.
2021-03-22 22:17:35 +01:00

36 lines
708 B
PHP

--TEST--
Bug #80889 (Cannot set save handler when save_handler is invalid)
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
session.save_handler=whatever
--FILE--
<?php
$initHandler = ini_get('session.save_handler');
session_set_save_handler(
function ($savePath, $sessionName) {
return true;
},
function () {
return true;
},
function ($id) {
return '';
},
function ($id, $data) {
return true;
},
function ($id) {
return true;
},
function ($maxlifetime) {
return true;
}
);
$setHandler = ini_get('session.save_handler');
var_dump($initHandler, $setHandler);
?>
--EXPECT--
string(8) "whatever"
string(4) "user"