diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2021-03-19 17:05:32 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2021-03-19 17:05:32 +0100 |
commit | 64e589cab6fcc953f111d6da2a4c137f6f97d5f3 (patch) | |
tree | 87f641d0b445b434f821d14ca8247a375956be03 /ext/session/tests | |
parent | 5fd2a5b13b6e0bb5261f1032056856c09649c5fa (diff) | |
parent | 2a1ed81ffcd50d493cfbabe2a155328081c6e6c8 (diff) | |
download | php-git-64e589cab6fcc953f111d6da2a4c137f6f97d5f3.tar.gz |
Merge branch 'PHP-8.0'
* PHP-8.0:
Fix #80889: Cannot set save handler when save_handler is invalid
Diffstat (limited to 'ext/session/tests')
-rw-r--r-- | ext/session/tests/bug80889.phpt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ext/session/tests/bug80889.phpt b/ext/session/tests/bug80889.phpt new file mode 100644 index 0000000000..78e1a6ab64 --- /dev/null +++ b/ext/session/tests/bug80889.phpt @@ -0,0 +1,37 @@ +--TEST-- +Bug #80889 (Cannot set save handler when save_handler is invalid) +--SKIPIF-- +<?php include('skipif.inc'); ?> +--INI-- +session.save_handler=whatever +--FILE-- +<?php +class DummyHandler implements SessionHandlerInterface { + public function open($savePath, $sessionName) { + return true; + } + public function close() { + return true; + } + public function read($id) { + return ''; + } + public function write($id, $data) { + return true; + } + public function destroy($id) { + return true; + } + public function gc($maxlifetime) { + return true; + } +} + +$initHandler = ini_get('session.save_handler'); +session_set_save_handler(new DummyHandler()); +$setHandler = ini_get('session.save_handler'); +var_dump($initHandler, $setHandler); +?> +--EXPECT-- +string(8) "whatever" +string(4) "user" |