1--TEST-- 2Test session_set_save_handler() function : error functionality 3--SKIPIF-- 4<?php include('skipif.inc'); ?> 5--INI-- 6error_reporting=0 7--FILE-- 8<?php 9 10ob_start(); 11 12echo "*** Testing session_set_save_handler() : error functionality ***\n"; 13 14function open($save_path, $session_name) { return true; } 15function close() { return true; } 16function read($id) { return false; } 17function write($id, $session_data) { } 18function destroy($id) { return true; } 19function gc($maxlifetime) { return true; } 20 21session_set_save_handler("open", "close", "read", "write", "destroy", "gc"); 22 23session_start(); 24$_SESSION["Blah"] = "Hello World!"; 25$_SESSION["Foo"] = FALSE; 26$_SESSION["Guff"] = 1234567890; 27var_dump($_SESSION); 28 29session_write_close(); 30var_dump($_SESSION); 31session_set_save_handler("open", "close", "read", "write", "destroy", "gc"); 32session_start(); 33var_dump($_SESSION); 34session_destroy(); 35 36ob_end_flush(); 37?> 38--EXPECT-- 39*** Testing session_set_save_handler() : error functionality *** 40array(3) { 41 ["Blah"]=> 42 string(12) "Hello World!" 43 ["Foo"]=> 44 bool(false) 45 ["Guff"]=> 46 int(1234567890) 47} 48array(3) { 49 ["Blah"]=> 50 string(12) "Hello World!" 51 ["Foo"]=> 52 bool(false) 53 ["Guff"]=> 54 int(1234567890) 55} 56array(0) { 57} 58