1--TEST--
2Testing mysqli.max_links
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--INI--
9mysqli.max_links=1
10--FILE--
11<?php
12    require_once("connect.inc");
13    require_once("table.inc");
14
15    // to make sure we have at least one working connection...
16    var_dump(mysqli_ping($link));
17    // to make sure that max_links is really set to one
18    var_dump((int)ini_get('mysqli.max_links'));
19
20    $links = array();
21    for ($i = 1; $i <= 5; $i++)
22        if ($links[$i] = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
23            printf("[%03d] One link is already open, it should not be possible to open more, [%d] %s, [%d] %s\n",
24                $i, mysqli_connect_errno(), mysqli_connect_error(),
25                mysqli_errno($links[$i]), mysqli_error($links[$i]));
26
27    mysqli_close($link);
28    print "done!";
29?>
30--CLEAN--
31<?php
32	require_once("clean_table.inc");
33?>
34--EXPECTF--
35bool(true)
36int(1)
37
38Warning: mysqli_%sonnect(): Too many open links (1) in %s on line %d
39
40Warning: mysqli_%sonnect(): Too many open links (1) in %s on line %d
41
42Warning: mysqli_%sonnect(): Too many open links (1) in %s on line %d
43
44Warning: mysqli_%sonnect(): Too many open links (1) in %s on line %d
45
46Warning: mysqli_%sonnect(): Too many open links (1) in %s on line %d
47done!
48