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