Bug #74737 [Ver->Csd]: Incorrect ReflectionFunction information for mysqli_get_client_info
Edit report at https://bugs.php.net/bug.php?id=74737&edit=1
ID: 74737
Updated by: nikic@php.net
Reported by: tandre at themeetgroup dot com
Summary: Incorrect ReflectionFunction information for
mysqli_get_client_info
-Status: Verified
+Status: Closed
Type: Bug
Package: MySQLi related
PHP Version: Irrelevant
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Resolved by https://github.com/php/php-src/pull/2579 / https://github.com/php/php-src/commit/eea4b0b912d9d88fdef555745d68ce5a44f180e2
a long time ago.
Previous Comments:
------------------------------------------------------------------------
[2017-06-10 04:39:18] requinix@php.net
Doesn't take any arguments at all - required or optional.
------------------------------------------------------------------------
[2017-06-10 04:27:36] 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)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74737&edit=1
Thread (3 messages)