xref: /PHP-8.2/ext/mysqli/tests/071.phpt (revision 62d393b1)
1--TEST--
2mysqli thread_id & kill
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once('skipifconnectfailure.inc');
8?>
9--FILE--
10<?php
11    require_once("connect.inc");
12
13    $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
14    $version = $mysql->server_version;
15
16    var_dump($mysql->ping());
17
18    $ret = $mysql->kill($mysql->thread_id);
19    if ($ret !== true){
20        printf("[001] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
21    }
22
23    var_dump($mysql->ping());
24
25    $mysql->close();
26
27    $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
28
29    var_dump(mysqli_ping($mysql));
30
31    $ret = $mysql->kill($mysql->thread_id);
32    if ($ret !== true){
33        printf("[002] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
34    }
35
36    var_dump(mysqli_ping($mysql));
37
38    $mysql->close();
39    print "done!";
40?>
41--EXPECT--
42bool(true)
43bool(false)
44bool(true)
45bool(false)
46done!
47