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
13echo "*** Testing session_set_save_handler() : incorrect arguments for existing handler close ***\n";
14
15class MySession extends SessionHandler {
16    public $i = 0;
17    public function open($path, $name) {
18        ++$this->i;
19        echo 'Open ', session_id(), "\n";
20        return parent::open($path, $name);
21    }
22    public function read($key) {
23        ++$this->i;
24        echo 'Read ', session_id(), "\n";
25        return parent::read($key);
26    }
27    public function close() {
28        return parent::close(false);
29    }
30}
31
32$oldHandler = ini_get('session.save_handler');
33$handler = new MySession;
34session_set_save_handler($handler);
35session_start();
36
37var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i, $_SESSION);
38?>
39--EXPECTF--
40*** Testing session_set_save_handler() : incorrect arguments for existing handler close ***
41Open
42Read %s
43string(%d) "%s"
44string(5) "files"
45string(4) "user"
46int(2)
47array(0) {
48}
49
50Fatal error: Uncaught ArgumentCountError: SessionHandler::close() expects exactly 0 arguments, 1 given in %s:%d
51Stack trace:
52#0 %s(%d): SessionHandler->close(false)
53#1 [internal function]: MySession->close()
54#2 [internal function]: session_write_close()
55#3 {main}
56  thrown in %s on line %d
57