php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32817 array_multisort
Submitted: 2005-04-25 04:55 UTC Modified: 2005-04-25 10:05 UTC
From: tianlin dot wang at sas dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 5.0.4 OS: REDHAT 9
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 !
Your email address:
MUST BE VALID
Solve the problem:
46 - 32 = ?
Subscribe to this entry?

 
 [2005-04-25 04:55 UTC] tianlin dot wang at sas dot com
Description:
------------
It seems to me that array_multisort() is not working properly (does not sort at all) for a reference to an array. The example code is listed below. I noticed that sort() works properly.

<?PHP
$p['us'] = array();
$arr = &$p['us'];
$arr[]=4;
$arr[]=2;
$arr[]=1;
$arr[]=5;
array_multisort($arr);
//sort($arr); this works properly.

for ($i=0; $i<count($arr); $i++) {
   echo($arr[$i]);
   echo("\n");
}
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-25 10:05 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See bug #25359 (same reason: reference)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 09:01:26 2024 UTC