1--TEST--
2Test session_set_save_handler(): incomplete implementation
3--INI--
4session.save_handler=files
5session.name=PHPSESSID
6session.gc_probability=0
7--EXTENSIONS--
8session
9--FILE--
10<?php
11
12ob_start();
13
14echo "*** Testing session_set_save_handler() : incomplete implementation ***\n";
15
16class MySession6 extends SessionHandler {
17    public function open($path, $name): bool {
18        // don't call parent
19        return true;
20    }
21
22    public function read($id): string|false {
23        // should error because parent::open hasn't been called
24        return parent::read($id);
25    }
26}
27
28$handler = new MySession6;
29session_set_save_handler($handler);
30var_dump(session_start());
31
32var_dump(session_id(), ini_get('session.save_handler'), $_SESSION);
33
34session_write_close();
35session_unset();
36?>
37--EXPECTF--
38*** Testing session_set_save_handler() : incomplete implementation ***
39
40Warning: SessionHandler::read(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d
41
42Warning: SessionHandler::close(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d
43
44Warning: session_start(): Failed to read session data: user (%s) in %ssession_set_save_handler_class_005.php on line %d
45bool(false)
46string(0) ""
47string(4) "user"
48array(0) {
49}
50