php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74468 Wrong reflection on Collator::sortWithSortKeys
Submitted: 2017-04-18 15:02 UTC Modified: 2017-04-19 16:04 UTC
From: fabien dot villepinte at gmail dot com Assigned:
Status: Closed Package: intl (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID:
 [2017-04-18 15:02 UTC] fabien dot villepinte at gmail dot com
Description:
------------
The Collator::sortWithSortKeys() method and the collator_sort_with_sort_keys() function have one extra parameter by reflection compared to the documentation ( 
http://php.net/manual/en/collator.sortwithsortkeys.php ).

If we call the method with 2 parameters the following warning is emitted:
Warning: Collator::sortWithSortKeys() expects exactly 1 parameter, 2 given

Test script:
---------------
<?php
$rm = new ReflectionMethod(Collator::class, 'sortWithSortKeys');
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());

$rf = new ReflectionFunction('collator_sort_with_sort_keys');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());

Expected result:
----------------
int(1)
int(1)
int(2)
int(2)

Actual result:
--------------
int(2)
int(1)
int(3)
int(2)

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-19 16:04 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2017-05-02 05:22 UTC] krakjoe@php.net
Automatic comment on behalf of fabien.villepinte@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f50df1d0e33aaf5007670966ca067318e064df82
Log: Fix bug #74468 wrong reflection on Collator::sortWithSortKeys
 [2017-05-02 05:22 UTC] krakjoe@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Mon Jun 26 20:01:38 2017 UTC