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