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