1--TEST-- 2Test session_set_save_handler() function : error functionality 3--EXTENSIONS-- 4session 5--FILE-- 6<?php 7 8ob_start(); 9 10echo "*** Testing session_set_save_handler() : error functionality ***\n"; 11 12function callback() { return true; } 13 14try { 15 session_set_save_handler("callback", "callback", "callback", "callback", "callback", "callback"); 16} catch (TypeError $exception) { 17 echo $exception->getMessage() . "\n"; 18} 19 20try { 21 session_set_save_handler("callback", "echo", "callback", "callback", "callback", "callback"); 22} catch (TypeError $exception) { 23 echo $exception->getMessage() . "\n"; 24} 25 26try { 27 session_set_save_handler("callback", "callback", "echo", "callback", "callback", "callback"); 28} catch (TypeError $exception) { 29 echo $exception->getMessage() . "\n"; 30} 31 32try { 33 session_set_save_handler("callback", "callback", "callback", "echo", "callback", "callback"); 34} catch (TypeError $exception) { 35 echo $exception->getMessage() . "\n"; 36} 37 38try { 39 session_set_save_handler("callback", "callback", "callback", "callback", "echo", "callback"); 40} catch (TypeError $exception) { 41 echo $exception->getMessage() . "\n"; 42} 43 44try { 45 session_set_save_handler("callback", "callback", "callback", "callback", "callback", "echo"); 46} catch (TypeError $exception) { 47 echo $exception->getMessage() . "\n"; 48} 49 50session_set_save_handler("callback", "callback", "callback", "callback", "callback", "callback"); 51 52var_dump(session_start()); 53ob_end_flush(); 54?> 55--EXPECTF-- 56*** Testing session_set_save_handler() : error functionality *** 57 58Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d 59 60Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d 61session_set_save_handler(): Argument #2 ($close) must be a valid callback, function "echo" not found or invalid function name 62 63Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d 64session_set_save_handler(): Argument #3 ($read) must be a valid callback, function "echo" not found or invalid function name 65 66Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d 67session_set_save_handler(): Argument #4 ($write) must be a valid callback, function "echo" not found or invalid function name 68 69Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d 70session_set_save_handler(): Argument #5 ($destroy) must be a valid callback, function "echo" not found or invalid function name 71 72Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d 73session_set_save_handler(): Argument #6 ($gc) must be a valid callback, function "echo" not found or invalid function name 74 75Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d 76 77Warning: session_start(): Failed to read session data: user (%s) in %s on line %d 78bool(false) 79