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