1--TEST--
2function test: mysqli_num_fields() 2
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once dirname(__DIR__) . "/test_setup/test_helpers.inc";
8mysqli_check_skip_test();
9?>
10--FILE--
11<?php
12require_once dirname(__DIR__) . "/test_setup/test_helpers.inc";
13
14    $link = default_mysqli_connect();
15
16    mysqli_real_query($link, "SHOW VARIABLES");
17
18    if (mysqli_field_count($link)) {
19        $result = mysqli_store_result($link);
20        $num = mysqli_num_fields($result);
21        mysqli_free_result($result);
22    }
23
24    var_dump($num);
25
26    mysqli_close($link);
27    print "done!";
28?>
29--EXPECT--
30int(2)
31done!
32