#19110 [NEW]: ksort. not properly sorting array

From: Date: Mon, 26 Aug 2002 16:13:53 +0000
Subject: #19110 [NEW]: ksort. not properly sorting array
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17873@lists.php.net to get a copy of this message
From: matt@usrlocal.com Operating system: Solaris 8 PHP version: 4.2.2 PHP Bug Type: Arrays related Bug description: ksort. not properly sorting array 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 bug report at http://bugs.php.net/?id=19110&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19110&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19110&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19110&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19110&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19110&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19110&r=support Expected behavior: http://bugs.php.net/fix.php?id=19110&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19110&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19110&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19110&r=globals

« previous php.bugs (#17873) next »