xref: /php-src/ext/mysqli/tests/bug72701.phpt (revision a21edc52)
1--TEST--
2Bug #72701 mysqli_get_host_info() wrong output
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8
9if ("127.0.0.1" != $host && "localhost" != $host) {
10    die("skip require 127.0.0.1 connection");
11}
12
13?>
14--FILE--
15<?php
16
17require_once 'connect.inc';
18
19$con = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
20
21if (mysqli_connect_errno()) {
22    echo "Failed to connect to MySQL: " . mysqli_connect_error();
23}
24
25var_dump(preg_match(",(127.0.0.1|localhost) via .*,i", mysqli_get_host_info($con)));
26
27mysqli_close($con);
28?>
29--EXPECT--
30int(1)
31