If I create two parallel connections to two servers:
$gw03 = new mysqli('gw03.example', 'user', 'pass', 'db');
$gw04 = new mysqli('gw04.example', 'user', 'pass', 'db');
if (!$gw03->connect_errno) {
...
} else if (!$gw04->connect_errno) {
...
} else {
echo "Failed to connect to gw03: (" . $gw03->connect_errno . ") " . $gw03->connect_error . PHP_EOL;
echo "Failed to connect to gw04: (" . $gw04->connect_errno . ") " . $gw04->connect_error . PHP_EOL;
}
If gw03 is available but gw04 is not, the following is the result
Failed to connect to gw03: (2002) No route to host
Failed to connect to gw04: (2002) No route to host
The failure to connect to $gw04 seems to overwrite $gw03. Aren't $gw03 and $gw04 separate objects? What's going on here?