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