php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19110 ksort. not properly sorting array
Submitted: 2002-08-26 12:13 UTC Modified: 2002-08-26 20:36 UTC
From: matt at usrlocal dot com Assigned:
Status: Closed Package: Arrays related
PHP Version: 4.2.2 OS: Solaris 8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: matt at usrlocal dot com
New email:
PHP Version: OS:

 

 [2002-08-26 12:13 UTC] matt at usrlocal dot 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



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-26 12:18 UTC] 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 20:36 UTC] sniper@php.net
This should be fixed in CVS now. And also in the next PHP 4.2.3 RC.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 14:01:32 2024 UTC