1--TEST--
2mysqli_close()
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once('skipifconnectfailure.inc');
8?>
9--FILE--
10<?php
11    require_once("connect.inc");
12
13    $tmp    = NULL;
14    $link   = NULL;
15
16    if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket))
17        printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
18            $host, $user, $db, $port, $socket);
19
20    $tmp = $mysqli->close();
21    if (true !== $tmp)
22        printf("[003] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
23
24    try {
25        $mysqli->close();
26    } catch (Error $exception) {
27        echo $exception->getMessage() . "\n";
28    }
29
30    try {
31        $mysqli->query("SELECT 1");
32    } catch (Error $exception) {
33        echo $exception->getMessage() . "\n";
34    }
35
36    print "done!";
37?>
38--EXPECT--
39my_mysqli object is already closed
40my_mysqli object is already closed
41done!
42