In PHP's [mysqli doc](http://php.net/manual/en/mysqli.construct.php), it says 

> 
> mysqli mysqli\_connect ([ string $host = ini\_get("mysqli.default\_host")
>  [, string $username = ini\_get("mysqli.default\_user") [, string $passwd
>  = ini\_get("mysqli.default\_pw") [, string $dbname = "" [, int $port = ini\_get("mysqli.default\_port") [, string $socket =
>  ini\_get("mysqli.default\_socket") ]]]]]] )
> 
> 
> 

but when I do 

```
$dblink = new \mysqli($c['host'], $c['user'], $c['pass'], $c['name'], $c['port']);

```

it connect to the default port.
Only after I did this 

```
$dblink = new \mysqli($c['host'].":".$c['port'], $c['user'], $c['pass'], $c['name'], $c['port']);

```

did it connect to the right port.