Bug #75434 [Com]: Wrong reflection for mysqli_fetch_all function

From: Date: Tue, 24 Oct 2017 22:12:17 +0000
Subject: Bug #75434 [Com]: Wrong reflection for mysqli_fetch_all function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212302@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75434&edit=1 ID: 75434 Comment by: mavimo at gmail dot com Reported by: hello at ohartl dot de Summary: Wrong reflection for mysqli_fetch_all function Status: Open Type: Bug Package: MySQLi related Operating System: Ubuntu PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Expected and actual results seems need to be: Actual result: ---------------- int(1) int(1) int(0) int(0) Expected result: -------------- int(2) int(1) int(1) int(0) Previous Comments: ------------------------------------------------------------------------ [2017-10-24 21:32:07] hello at ohartl dot de Description: ------------ Reflection for procedural style function "mysqli_fetch_all" only returns the first (required) parameter "result", but the second optional parameter "resulttype" is missing. Also the reflection for "mysqli_result::fetch_all" does not return any parameter, while one "resulttype" is optional. (see https://secure.php.net/mysqli_fetch_all) There was no point in writing more complex tests to demonstrate the problem. This caused problems in phpstan https://github.com/phpstan/phpstan/issues/549 Test script: --------------- $reflection = new \ReflectionFunction('mysqli_fetch_all'); $parameters = $reflection->getParameters(); var_dump($reflection->getNumberOfParameters()); var_dump($reflection->getNumberOfRequiredParameters()); $reflection = new \ReflectionMethod('mysqli_result', 'fetch_all'); $parameters = $reflection->getParameters(); var_dump($reflection->getNumberOfParameters()); var_dump($reflection->getNumberOfRequiredParameters()); Expected result: ---------------- int(1) int(1) int(0) int(0) Actual result: -------------- int(2) int(1) int(1) int(0) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75434&edit=1

« previous php.bugs (#212302) next »