1--TEST--
2mysqli_stmt_init()
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10    /*
11    NOTE: no datatype tests here! This is done by
12    mysqli_stmt_bind_result.phpt already. Restrict
13    this test case to the basics.
14    */
15    require_once("connect.inc");
16
17    require('table.inc');
18
19    if (!is_object($stmt = mysqli_stmt_init($link)))
20        printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
21
22    if (!is_object($stmt2 = @mysqli_stmt_init($link)))
23        printf("[003a] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
24
25    try {
26        mysqli_stmt_close($stmt);
27    } catch (Error $exception) {
28        echo $exception->getMessage() . "\n";
29    }
30
31    mysqli_close($link);
32
33    try {
34        mysqli_stmt_init($link);
35    } catch (Error $exception) {
36        echo $exception->getMessage() . "\n";
37    }
38
39    print "done!";
40?>
41--CLEAN--
42<?php
43    require_once("clean_table.inc");
44?>
45--EXPECT--
46mysqli_stmt object is not fully initialized
47mysqli object is already closed
48done!
49