1--TEST--
2Test session_set_save_handler() : default object
3--INI--
4session.save_handler=files
5session.name=PHPSESSID
6--SKIPIF--
7<?php include('skipif.inc'); ?>
8--FILE--
9<?php
10
11ob_start();
12
13/*
14 * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
15 * Description : Sets user-level session storage functions
16 * Source code : ext/session/session.c
17 */
18
19echo "*** Testing session_set_save_handler() : default object ***\n";
20
21session_set_save_handler(new SessionHandler);
22session_start();
23
24$_SESSION['foo'] = "hello";
25
26var_dump(session_id(), ini_get('session.save_handler'), $_SESSION);
27
28session_write_close();
29session_unset();
30session_start();
31
32var_dump($_SESSION);
33
34session_write_close();
35session_unset();
36--EXPECTF--
37*** Testing session_set_save_handler() : default object ***
38string(%d) "%s"
39string(4) "user"
40array(1) {
41  ["foo"]=>
42  string(5) "hello"
43}
44array(1) {
45  ["foo"]=>
46  string(5) "hello"
47}
48