hhvm
hhvm copied to clipboard
mysqli::real_connect does not convert string to integer in port number argument
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.
This was partially fixed in f03f434e2ea I take a look at it later.
We'll probably take that fix, though FYI, the correct long-term fix is https://github.com/facebook/hhvm/issues/1669