php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19023 sort of an array is incorrect
Submitted: 2002-08-21 11:37 UTC Modified: 2002-08-21 11:52 UTC
From: superflow at gmx dot ch Assigned:
Status: Closed Package: Arrays related
PHP Version: 4.2.1 OS: Mac OS Darwin 10.1.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
14 + 14 = ?
Subscribe to this entry?

 
 [2002-08-21 11:37 UTC] superflow at gmx dot ch
Description
after the ksort-function the arraykeyelement 
101010501010101010100 ist bigger than 101010501010101010101 
hm.

Test-Script
<?php
	$sortArray = array ( '101010501010101010101' => '23|10', 
'101010501010101010100' => '22|9', '101010501010101010000' 
=> '21|8', '101010501010101000000' => '20|7', 
'101010501010100000000' => '19|6', '101010501010000000000' 
=> '18|5', '101010501000000000000' => '15|4', 
'101010800000000000000' => '14|3', '101010700000000000000' 
=> '12|3', '101010600000000000000' => '13|3', 
'101010500000000000000' => '11|3', '101010400000000000000' 
=> '16|3', '101010300000000000000' => '17|3', 
'101010200000000000000' => '10|3', '101010100000000000000' 
=> '6|3', '102030000000000000000' => '9|2', 
'102020000000000000000' => '8|2', '102010000000000000000' =
> '7|2', '101030000000000000000' => '5|2', 
'101020000000000000000' => '4|2', '101010000000000000000' =
> '2|2', '102000000000000000000' => '3|1', 
'101000000000000000000' => '1|1' );
	var_dump( $sortArray );
	ksort( $sortArray );
	var_dump( $sortArray );
?>

Configure Command	
'./configure' '--disable-cli' '--with-apxs' '--with-mysql' 
'--with-pgsql' '--with-gd=/usr/local' '--with-png-dir=/usr/
local' '--with-zlib-dir=/usr' '--with-jpeg-dir=/usr/local' 
'--with-freetype-dir=/usr/local' '--with-t1lib=/usr/local' 
'--enable-trans-sid' '--enable-exif' '--with-xml' '--
enable-wddx' '--with-curl=/usr/local' '--with-pdflib=/usr/
local' '--enable-ftp' '--enable-mbstring' '--enable-mbstr-
enc-trans' '--with-ldap' '--enable-xslt' '--with-xslt-
sablot=/usr/local' '--with-imap=../imap-2001a' '--enable-
dbx' '--enable-dbase' '--with-mcrypt=/usr/local' '--enable-
sockets'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-21 11:52 UTC] kalowsky@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 10:01:30 2024 UTC