1--TEST--
2Test session_module_name() function : variation
3--INI--
4session.save_path=
5session.name=PHPSESSID
6session.save_handler=files
7--SKIPIF--
8<?php include('skipif.inc'); ?>
9--FILE--
10<?php
11
12ob_start();
13
14/*
15 * Prototype : string session_module_name([string $module])
16 * Description : Get and/or set the current session module
17 * Source code : ext/session/session.c
18 */
19
20echo "*** Testing session_module_name() : variation ***\n";
21function open($save_path, $session_name) {
22    throw new Exception("Stop...!");
23}
24
25function close() { return true; }
26function read($id) { return ''; }
27function write($id, $session_data) { return true; }
28function destroy($id) { return true; }
29function gc($maxlifetime) { return true; }
30
31var_dump(session_module_name("files"));
32session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
33var_dump(session_module_name());
34var_dump(session_start());
35var_dump(session_module_name());
36var_dump(session_destroy());
37
38ob_end_flush();
39?>
40--EXPECTF--
41*** Testing session_module_name() : variation ***
42string(5) "files"
43string(4) "user"
44
45Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line 25
46
47Fatal error: Uncaught Exception: Stop...! in %s:13
48Stack trace:
49#0 [internal function]: open('', 'PHPSESSID')
50#1 %s(25): session_start()
51#2 {main}
52  thrown in %s on line 13
53