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: 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: fabien dot villepinte at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

Pull requests:

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 10 07:01:28 2024 UTC