php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74737 Incorrect ReflectionFunction information for mysqli_get_client_info
Submitted: 2017-06-10 04:27 UTC Modified: 2018-02-13 21:05 UTC
From: tandre at themeetgroup dot com Assigned: nikic (profile)
Status: Closed Package: MySQLi related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tandre at themeetgroup dot com
New email:
PHP Version: OS:

 

 [2017-06-10 04:27 UTC] tandre at themeetgroup dot com
Description:
------------
ReflectionFunction reports that mysqli_get_client_info has 1 required parameter. This is incorrect. Currently, it ignores the values of its parameters.


See the example provided with https://secure.php.net/manual/en/mysqli.get-client-info.php#refsect1-mysqli.get-client-info-examples

> /* We don't need a connection to determine
>   the version of mysql client library */

(Also, the documented function signature should be changed to indicate that the parameter is optional, but that's not the main part of this issue)

Test script:
---------------
var_dump((new ReflectionFunction('mysqli_get_client_info'))->getNumberOfRequiredParameters());
var_dump((new ReflectionFunction('mysqli_get_client_info'))->getNumberOfOptionalParameters());

Expected result:
----------------
// 0 required parameters, might as well say 1 optional parameter
int(0)
int(1)


Actual result:
--------------
// incorrectly says there is 1 required parameter

int(1)
int(1)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-10 04:39 UTC] requinix@php.net
-Status: Open +Status: Verified
 [2017-06-10 04:39 UTC] requinix@php.net
Doesn't take any arguments at all - required or optional.
 [2018-02-13 21:05 UTC] nikic@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: nikic
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Feb 04 00:01:31 2025 UTC