hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

mysqli::real_connect does not convert string to integer in port number argument

Open berle opened this issue 12 years ago • 2 comments

This issue affects the adminer database management script, but is easy to reproduce without it:

<?php
$mysqli = mysqli_init();
$mysqli->real_connect("localhost", "user", "password", "database", "3306");

It expects the string "3306" to be an integer and exits with the following error message:

Fatal error: Argument 5 to mysqli::real_connect() must be of type ?int, string given

The regular PHP implementation will run this code without problems, converting the string to an integer transparently.

berle avatar Jun 02 '14 04:06 berle

This was partially fixed in f03f434e2ea I take a look at it later.

SiebelsTim avatar Jun 02 '14 06:06 SiebelsTim

We'll probably take that fix, though FYI, the correct long-term fix is https://github.com/facebook/hhvm/issues/1669

fredemmott avatar Jun 02 '14 17:06 fredemmott