php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #76151 Mention false return value on mysqli_connect failure
Submitted: 2018-03-26 15:16 UTC Modified: 2019-10-13 15:03 UTC
From: phpbugs at personal dot formauri dot es Assigned: cmb (profile)
Status: Closed Package: MySQLi related
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phpbugs at personal dot formauri dot es
New email:
PHP Version: OS:

 

 [2018-03-26 15:16 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-26 15:49 UTC] 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:50 UTC] cmb@php.net
-Package: Documentation problem +Package: MySQLi related
 [2018-03-26 15:52 UTC] requinix@php.net
-Summary: Mention false return value on mysqli::__construct failure +Summary: Mention false return value on mysqli_connect failure
 [2018-03-26 15:52 UTC] requinix@php.net
I believe phpbugs means the mysqli_connect function.
 [2018-03-26 16:46 UTC] 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 18:09 UTC] requinix@php.net
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.
 [2019-10-13 15:02 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=348150
Log: Fix #76151: Mention false return value on mysqli_connect failure
 [2019-10-13 15:03 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2019-10-13 15:03 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2019-10-13 15:05 UTC] salathe@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=61c316ed7356d78dc400410e2a83fec78b1e4de9
Log: Fix #76151: Mention false return value on mysqli_connect failure
 [2020-02-07 06:04 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=2a92e38e4f50aec0f165945bfb2901c7595cef6d
Log: Fix #76151: Mention false return value on mysqli_connect failure
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 21:01:31 2024 UTC