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
View Add Comment Developer Edit
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
49 - 1 = ?
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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 25 10:01:29 2024 UTC