1--TEST-- 2Test session_set_save_handler() function : error functionality 3--EXTENSIONS-- 4session 5--INI-- 6error_reporting=0 7--FILE-- 8<?php 9 10ob_start(); 11 12echo "*** Testing session_set_save_handler() : error functionality ***\n"; 13 14class MySessionHandler implements SessionHandlerInterface { 15 function open($save_path, $session_name): bool { return true; } 16 function close(): bool { return true; } 17 function read($id): string|false { return false; } 18 function write($id, $session_data): bool { } 19 function destroy($id): bool { return true; } 20 function gc($maxlifetime): int|false { return true; } 21} 22 23session_set_save_handler(new MySessionHandler()); 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(new MySessionHandler()); 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