1--TEST--
2Test session_set_save_handler() function : error functionality
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_set_save_handler() : error functionality ***\n";
15function open($save_path, $session_name) {
16     throw new Exception("Do something bad..!");
17}
18
19function close() { return true; }
20function read($id) { return false; }
21function write($id, $session_data) { }
22function destroy($id) {  return true; }
23function gc($maxlifetime) {  return true; }
24
25session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
26session_start();
27ob_end_flush();
28?>
29--EXPECTF--
30*** Testing session_set_save_handler() : error functionality ***
31
32Fatal error: Uncaught Exception: Do something bad..! in %s:%d
33Stack trace:
34#0 [internal function]: open('', 'PHPSESSID')
35#1 %s(%d): session_start()
36#2 {main}
37  thrown in %s on line %d
38