php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74595 ReflectionMethod::getParameters returns incorrect number of parameters
Submitted: 2017-05-15 09:48 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: skalicky dot tomas at hotmail dot com Assigned:
Status: Closed Package: Reflection related
PHP Version: 7.1.5 OS: All
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: skalicky dot tomas at hotmail dot com
New email:
PHP Version: OS:

 

 [2017-05-15 09:48 UTC] skalicky dot tomas at hotmail dot com
Description:
------------
Method mysqli::query supposed to have 2 parameters ($query [, $resultmode]), but ReflectionMethod::getParameters returns only first one.

http://php.net/manual/en/mysqli.query.php

Test script:
---------------
<?php

$class = new ReflectionClass('mysqli');

$method = $class->getMethod('query');

var_dump($method->getParameters());

Expected result:
----------------
array(2) { 
  [0]=> 
  object(ReflectionParameter)#3 (1) { 
    ["name"]=> string(5) "query" 
  }
  [1]=> 
  object(ReflectionParameter)#4 (1) { 
    ["name"]=> string(10) "resultmode" 
  } 
}

Actual result:
--------------
array(1) { 
  [0]=> object(ReflectionParameter)#3 (1) { 
    ["name"]=> string(5) "query" 
  } 
}

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-15 13:01 UTC] andrew dot nester dot dev at gmail dot com
thanks for reporting this issue!
just added PR fixing this.
 [2017-05-19 16:05 UTC] laruence@php.net
Automatic comment on behalf of andrew.nester.dev@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2e5a747b59b24a44dd95c7b68c1072927123dc0b
Log: Fixed #74595 - ReflectionMethod::getParameters returns incorrect number of parameters
 [2017-05-19 16:06 UTC] laruence@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Mar 12 09:01:28 2025 UTC