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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

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: Fri Apr 26 00:01:30 2024 UTC