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