Doc #76151 [Opn]: Mention false return value on mysqli_connect failure
| From: | requinix@php.net | Date: | Mon, 26 Mar 2018 18:09:35 +0000 |
| Subject: | Doc #76151 [Opn]: Mention false return value on mysqli_connect failure | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15571@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76151&edit=1
ID: 76151
Updated by: requinix@php.net
Reported by: phpbugs at personal dot formauri dot es
Summary: Mention false return value on mysqli_connect failure
Status: Open
Type: Documentation Problem
Package: MySQLi related
Operating System: N/A
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
mysqli_connect and mysqli::__construct are the same thing internally so it is good for them to share
documentation. Some other classes are in the same situation too, like DateTime. Including the return
value is fine.
Previous Comments:
------------------------------------------------------------------------
[2018-03-26 16:46:15] phpbugs at personal dot formauri dot es
Yes, my apologies. I was testing with mysqli_connect() and I believed the manual when it said that
it was an alias of mysqli::__construct().
So I guess that mysqli_connect() should have a separate documentation if it handles the return value
differently.
------------------------------------------------------------------------
[2018-03-26 15:52:22] requinix@php.net
I believe phpbugs means the mysqli_connect function.
------------------------------------------------------------------------
[2018-03-26 15:49:18] danack@php.net
Please could you provide a reproduce case, just to make adding a test be trivial.
I think this behaviour is a bug since this RFC was passed: https://wiki.php.net/rfc/internal_constructor_behaviour
------------------------------------------------------------------------
[2018-03-26 15:16:42] phpbugs at personal dot formauri dot es
Description:
------------
When mysqli::__construct fails to connect, the return value is boolean false, but this is not
mentioned in the documentation.
Affected page: http://php.net/manual/en/mysqli.construct.php
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76151&edit=1