xref: /PHP-8.0/ext/mysqli/tests/bug72701.phpt (revision e3e67b72)
1--TEST--
2Bug #72701 mysqli_get_host_info() wrong output
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7require_once("connect.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