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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tianlin dot wang at sas dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 22 17:01:30 2025 UTC