1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00
Files
archived-php-src/ext/session/tests/user_session_module/bug80889a.phpt
T
Christoph M. Becker 217ea732fc Use php_error_docref() instead of zend_error() in session.c (GH-15505)
Using `php_error_docref()` is preferable since it outputs additional
details (which function has been called and whether it is a startup or
shutdown error), uses HTML markup, and also provides a link to the
documentation, if configured.

Since these deprecation warnings have been introduced recently[1][2],
i.e. for PHP 8.4, there are no BC concerns.

[1] <https://github.com/php/php-src/commit/e8ff7c70f9669f1a54c47c018ccc0f80bc0c929b>
[2] <https://github.com/php/php-src/commit/b36eac94d26bdced150d9d2178f6209893d9961f>

Co-authored-by: Máté Kocsis <kocsismate90@gmail.com>
2024-09-04 16:00:28 +02:00

39 lines
984 B
PHP

--TEST--
Bug #80889 (Cannot set save handler when save_handler is invalid)
--EXTENSIONS--
session
--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);
?>
--EXPECTF--
Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
Warning: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent in %s on line %d
string(8) "whatever"
string(8) "whatever"