1--TEST-- 2Test session_set_save_handler() : incomplete implementation 3--INI-- 4session.save_handler=files 5session.name=PHPSESSID 6session.gc_probability=0 7--SKIPIF-- 8<?php include('skipif.inc'); ?> 9--FILE-- 10<?php 11 12ob_start(); 13 14/* 15 * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true]) 16 * Description : Sets user-level session storage functions 17 * Source code : ext/session/session.c 18 */ 19 20echo "*** Testing session_set_save_handler() : incomplete implementation ***\n"; 21 22class MySession6 extends SessionHandler { 23 public function open($path, $name) { 24 // don't call parent 25 return true; 26 } 27 28 public function read($id) { 29 // should error because parent::open hasn't been called 30 return parent::read($id); 31 } 32} 33 34$handler = new MySession6; 35session_set_save_handler($handler); 36session_start(); 37 38var_dump(session_id(), ini_get('session.save_handler'), $_SESSION); 39 40session_write_close(); 41session_unset(); 42 43 44--EXPECTF-- 45*** Testing session_set_save_handler() : incomplete implementation *** 46 47Warning: SessionHandler::read(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d 48string(%d) "%s" 49string(4) "user" 50array(0) { 51} 52 53Warning: SessionHandler::write(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d 54 55Warning: session_write_close(): Failed to write session data %s in %ssession_set_save_handler_class_005.php on line %d 56 57Warning: SessionHandler::close(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d 58