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
14echo "*** Testing session_module_name() : variation ***\n";
15function open($save_path, $session_name) {
16    throw new Exception("Stop...!");
17}
18
19function close() { return true; }
20function read($id) { return ''; }
21function write($id, $session_data) { return true; }
22function destroy($id) { return true; }
23function gc($maxlifetime) { return true; }
24
25var_dump(session_module_name("files"));
26session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
27var_dump(session_module_name());
28var_dump(session_start());
29var_dump(session_module_name());
30var_dump(session_destroy());
31
32ob_end_flush();
33?>
34--EXPECTF--
35*** Testing session_module_name() : variation ***
36string(5) "files"
37string(4) "user"
38
39Fatal error: Uncaught Exception: Stop...! in %s:%d
40Stack trace:
41#0 [internal function]: open('', 'PHPSESSID')
42#1 %s(%d): session_start()
43#2 {main}
44  thrown in %s on line %d
45