php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68422 Incorrect argument reflection info for array_multisort()
Submitted: 2014-11-14 12:39 UTC Modified: 2014-11-24 00:42 UTC
From: lisachenko dot it at gmail dot com Assigned: stas (profile)
Status: Closed Package: Reflection related
PHP Version: master-Git-2014-11-14 (Git) OS:
Private report: No CVE-ID: None
 [2014-11-14 12:39 UTC] lisachenko dot it at gmail dot com
Description:
------------
PHP7 requires that argument names should be unique. array_multisort ARG_INFO is invalid, because it contains duplicate names for arguments.

Also, http://php.net/manual/en/function.array-multisort.php declares the signature as the following:

bool array_multisort ( array &$array1 [, mixed $array1_sort_order = SORT_ASC [, mixed $array1_sort_flags = SORT_REGULAR [, mixed $... ]]] )

Test script:
---------------
php --rf array_multisort

Expected result:
----------------
Function [ <internal:standard> function array_multisort ] {

  - Parameters [7] {
    Parameter #0 [ <required> &$arr1 ]
    Parameter #1 [ <optional> &$sort_order ]
    Parameter #2 [ <optional> &$sort_flags ]
    Parameter #3 [ <optional> &...$arr2 ]
  }
}

Actual result:
--------------
Function [ <internal:standard> function array_multisort ] {

  - Parameters [7] {
    Parameter #0 [ <required> &$arr1 ]
    Parameter #1 [ <optional> &$SORT_ASC_or_SORT_DESC ]
    Parameter #2 [ <optional> &$SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING ]
    Parameter #3 [ <optional> &$arr2 ]
    Parameter #4 [ <optional> &$SORT_ASC_or_SORT_DESC ]
    Parameter #5 [ <optional> &$SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING ]
    Parameter #6 [ <optional> &...$more_array_and_sort_options ]
  }
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-14 12:42 UTC] lisachenko dot it at gmail dot com
PR on GitHub: https://github.com/php/php-src/pull/900
 [2014-11-24 00:42 UTC] stas@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
 [2014-11-24 00:42 UTC] stas@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

fixed by https://github.com/php/php-src/pull/900
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC