1--TEST--
2mysqli_get_client_stats() - php_ini setting
3--SKIPIF--
4<?PHP
5require_once('skipif.inc');
6require_once('skipifemb.inc');
7require_once('skipifconnectfailure.inc');
8if (!function_exists('mysqli_get_client_stats')) {
9	die("skip only available with mysqlnd");
10}
11?>
12--INI--
13mysqlnd.collect_statistics=0
14mysqlnd.collect_memory_statistics=0
15--FILE--
16<?php
17	$before = mysqli_get_client_stats();
18	if (!is_array($before) || empty($before)) {
19		printf("[001] Expecting non-empty array, got %s.\n", gettype($before));
20		var_dump($before);
21	}
22
23	// connect and table inc connect to mysql and create tables
24	require_once('connect.inc');
25	require_once('table.inc');
26	$after = mysqli_get_client_stats();
27
28	if ($before !== $after) {
29		printf("[002] Statistics have changed\n");
30		var_dump($before);
31		var_dump($after);
32	}
33
34	foreach ($after as $k => $v)
35		if ($v != 0) {
36			printf("[003] Field %s should not have any other value but 0, got %s.\n",
37				$k, $v);
38		}
39
40	mysqli_close($link);
41	print "done!";
42?>
43--CLEAN--
44<?php
45	require_once("clean_table.inc");
46?>
47--EXPECT--
48done!
49