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: 2017-06-10 04:39 UTC
From: tandre at themeetgroup dot com Assigned:
Status: Verified Package: MySQLi related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC