1--TEST--
2Test session_set_save_handler() : incorrect arguments for existing handler close
3--INI--
4session.save_handler=files
5session.name=PHPSESSID
6--SKIPIF--
7<?php include('skipif.inc'); ?>
8--FILE--
9<?php
10
11ob_start();
12
13/*
14 * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
15 * Description : Sets user-level session storage functions
16 * Source code : ext/session/session.c
17 */
18
19echo "*** Testing session_set_save_handler() : incorrect arguments for existing handler close ***\n";
20
21class MySession extends SessionHandler {
22	public $i = 0;
23	public function open($path, $name) {
24		++$this->i;
25		echo 'Open ', session_id(), "\n";
26		return parent::open($path, $name);
27	}
28	public function read($key) {
29		++$this->i;
30		echo 'Read ', session_id(), "\n";
31		return parent::read($key);
32	}
33	public function close() {
34		return parent::close(false);
35	}
36}
37
38$oldHandler = ini_get('session.save_handler');
39$handler = new MySession;
40session_set_save_handler($handler);
41session_start();
42
43var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i, $_SESSION);
44--EXPECTF--
45*** Testing session_set_save_handler() : incorrect arguments for existing handler close ***
46Open
47Read %s
48string(%d) "%s"
49string(5) "files"
50string(4) "user"
51int(2)
52array(0) {
53}
54
55Warning: SessionHandler::close() expects exactly 0 parameters, 1 given in %s on line %d
56