1--TEST--
2Test session_set_save_handler() function : error functionality
3--SKIPIF--
4<?php include('skipif.inc'); ?>
5--INI--
6error_reporting=0
7--FILE--
8<?php
9
10ob_start();
11
12/*
13 * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
14 * Description : Sets user-level session storage functions
15 * Source code : ext/session/session.c
16 */
17
18echo "*** Testing session_set_save_handler() : error functionality ***\n";
19
20function open($save_path, $session_name) { return true; }
21function close() { return true; }
22function read($id) { return false; }
23function write($id, $session_data) { }
24function destroy($id) {  return true; }
25function gc($maxlifetime) {  return true; }
26
27session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
28
29session_start();
30$_SESSION["Blah"] = "Hello World!";
31$_SESSION["Foo"] = FALSE;
32$_SESSION["Guff"] = 1234567890;
33var_dump($_SESSION);
34
35session_write_close();
36var_dump($_SESSION);
37session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
38session_start();
39var_dump($_SESSION);
40session_destroy();
41
42ob_end_flush();
43?>
44--EXPECTF--
45*** Testing session_set_save_handler() : error functionality ***
46array(3) {
47  ["Blah"]=>
48  string(12) "Hello World!"
49  ["Foo"]=>
50  bool(false)
51  ["Guff"]=>
52  int(1234567890)
53}
54array(3) {
55  ["Blah"]=>
56  string(12) "Hello World!"
57  ["Foo"]=>
58  bool(false)
59  ["Guff"]=>
60  int(1234567890)
61}
62array(0) {
63}
64
65