|  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
 [2017-06-10 04:27 UTC] tandre at themeetgroup dot com
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

> /* 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

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



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-10 04:39 UTC]
-Status: Open +Status: Verified
 [2017-06-10 04:39 UTC]
Doesn't take any arguments at all - required or optional.
 [2018-02-13 21:05 UTC]
-Status: Verified +Status: Closed -Assigned To: +Assigned To: nikic
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon May 29 16:03:42 2023 UTC