1--TEST--
2Test session_set_save_handler() : using objects in 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() : using objects in close ***\n";
14
15class MySession7_Foo {
16    public $state = 'ok';
17    function __destruct() {
18        $this->state = 'destroyed';
19    }
20}
21
22class MySession7 extends SessionHandler {
23    public $foo;
24    public function close() {
25        var_dump($this->foo);
26        @var_dump($GLOBALS['bar']);
27        return parent::close();
28    }
29}
30
31$bar = new MySession7_Foo;
32$handler = new MySession7;
33$handler->foo = new MySession7_Foo;
34session_set_save_handler($handler);
35session_start();
36
37ob_end_flush();
38?>
39--EXPECTF--
40*** Testing session_set_save_handler() : using objects in close ***
41object(MySession7_Foo)#%d (%d) {
42  ["state"]=>
43  string(2) "ok"
44}
45object(MySession7_Foo)#%d (%d) {
46  ["state"]=>
47  string(2) "ok"
48}
49