1--TEST--
2mysql_get_host_info()
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10include_once "connect.inc";
11
12if (NULL !== ($tmp = @mysql_get_host_info(NULL)))
13	printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
14
15require "table.inc";
16if (!is_string($info = mysql_get_host_info($link)) || ('' === $info))
17	printf("[003] Expecting string/any_non_empty, got %s/%s\n", gettype($info), $info);
18
19$def_info = mysql_get_host_info();
20if ($def_info !== $info) {
21	printf("[004] Host info for the default link and the specified link differ, [%d] %s\n",
22		mysql_errno(), mysql_error());
23
24	var_dump($def_info);
25	var_dump($info);
26}
27
28if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1) && !is_unicode($info)) {
29	printf("[005] Expecting Unicode error message!\n");
30	var_inspect($info);
31}
32
33if (!is_null($tmp = @mysql_get_host_info($link, "too many arguments"))) {
34	printf("[006] Expecting NULL/NULL got %s/%s\n", $tmp, gettype($tmp));
35}
36
37print "done!";
38?>
39--CLEAN--
40<?php
41require_once("clean_table.inc");
42?>
43--EXPECTF--
44Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d
45done!
46