Bug #74432 [Opn]: mysqli_connect adding ":3306" to $host if $port parameter not given

From: Date: Fri, 14 Apr 2017 13:17:00 +0000
Subject: Bug #74432 [Opn]: mysqli_connect adding ":3306" to $host if $port parameter not given
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208551@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74432&edit=1 ID: 74432 Updated by: ab@php.net Reported by: php dot bugs at harry dot lu Summary: mysqli_connect adding ":3306" to $host if $port parameter not given Status: Open Type: Bug Package: MySQLi related Operating System: Linux x86_64 PHP Version: 7.0.18 -Assigned To: +Assigned To: pollita Block user comment: N Private report: N New Comment: Sara, could you please check? Seems there might be other regressions related to #74216. Thanks. Previous Comments: ------------------------------------------------------------------------ [2017-04-13 11:23:34] php dot bugs at harry dot lu Description: ------------ Hello, This seems to be a regression in 7.0.18. If you give a port in the $host section of mysqli_connect, it will still add ":3306" to the end of it. > mysqli_connect("127.0.0.1:3306", "user", "pass", > "schema"); will return: > mysqli_connect(): (HY000/2002): Failed to parse address "127.0.0.1:3306:3306" Notice the double port assignment. People should be using the $port parameter if mysqli_connect and not giving ports like this, but it still seems like a regression to me. Thanks! Test script: --------------- <?php # Works in 7.0.17, broken in 7.0.18 mysqli_connect("127.0.0.1:3306", "user", "pass", "schema"); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74432&edit=1

« previous php.bugs (#208551) next »