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
37--EXPECTF--
38*** Testing session_set_save_handler() : default object ***
39string(%d) "%s"
40string(4) "user"
41array(1) {
42  ["foo"]=>
43  string(5) "hello"
44}
45array(1) {
46  ["foo"]=>
47  string(5) "hello"
48}
49