php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63989 ArrayIterator::usort method
Submitted: 2013-01-15 11:09 UTC Modified: 2017-09-21 08:54 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: franssen dot roland at gmail dot com Assigned:
Status: Open Package: SPL related
PHP Version: 5.3.20 OS: Linux
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
11 + 13 = ?
Subscribe to this entry?

 
 [2013-01-15 11:09 UTC] franssen dot roland at gmail dot com
Description:
------------
Hi,

There is currently no "ArrayIterator::usort" method which assigns new keys to the elements (e.g. usort vs uasort function).

Also the current user defined sort methods (uasort, uksort) don't accept a valid callable as argument (e.g. a closure). Only a string works :(


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-21 08:54 UTC] cmb@php.net
> Also the current user defined sort methods (uasort, uksort) don't accept a
> valid callable as argument (e.g. a closure). Only a string works :(

Actually, general callables are supported, see <https://3v4l.org/Rv61G>. The
documentation is wrong.
 [2017-09-21 09:18 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=343115
Log: Document ArrayIterator::uasort() and ::uksort()

This partially fixes request #63989 and also integrates
user note 118260.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC