#19110 [Dup->Csd]: ksort. not properly sorting array

From: Date: Tue, 27 Aug 2002 00:36:46 +0000
Subject: #19110 [Dup->Csd]: ksort. not properly sorting array
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17896@lists.php.net to get a copy of this message
ID: 19110 Updated by: sniper@php.net Reported By: matt@usrlocal.com -Status: Duplicate +Status: Closed Bug Type: Arrays related Operating System: Solaris 8 PHP Version: 4.2.2 New Comment: This should be fixed in CVS now. And also in the next PHP 4.2.3 RC. Previous Comments: ------------------------------------------------------------------------ [2002-08-26 12:18:57] nohn@php.net Are you running Solaris 8 on Sparc 64Bit? In this case it seems to be a duplicate to bug #17449. Please try http://snaps.php.net/php4-latest.tar.gz. ------------------------------------------------------------------------ [2002-08-26 12:13:53] matt@usrlocal.com I am currently setting up an array based on a timestamp from the system. So, I would have an array similiar to the following.... $event[1030251600] => Array(title => "Foo, Time => "Bar"); $event[1028329200] => Array(title => "Foo1", Time =>"Bar2"); $event[1028934000] => Array(title => "Foo2", Time =>"Bar3"); When I do a ksort($event, SORT_NUMERIC), I would expect this array to be sorted by the timestamp key value becoming..... $event[1028329200] => Array(title => "Foo1", Time =>"Bar2"); $event[1028934000] => Array(title => "Foo2", Time =>"Bar3"); $event[1030251600] => Array(title => "Foo, Time => "Bar"); It does in 4.1.2 but when we upgraded to 4.2.2, the array no longer sorts. We get the values from the array exactly how we had the array originally. Matt Patterson matt@usrlocal.com ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19110&edit=1

« previous php.bugs (#17896) next »