#32817 [Opn->Bgs]: array_multisort

From: Date: Mon, 25 Apr 2005 08:05:17 +0000
Subject: #32817 [Opn->Bgs]: array_multisort
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-78147@lists.php.net to get a copy of this message
ID: 32817 Updated by: sniper@php.net Reported By: tianlin dot wang at sas dot com -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: REDHAT 9 PHP Version: 5.0.4 New Comment: 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) Previous Comments: ------------------------------------------------------------------------ [2005-04-25 04:55:11] 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"); } ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32817&edit=1

« previous php.bugs (#78147) next »