#49003 [Fbk->Ana]: natsort: sort sequence has changed
| From: | rasmus@php.net | Date: | Tue, 21 Jul 2009 20:30:18 +0000 |
| Subject: | #49003 [Fbk->Ana]: natsort: sort sequence has changed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-140029@lists.php.net to get a copy of this message | ||
ID: 49003
Updated by: rasmus@php.net
Reported By: h dot beuttenmueller at gmx dot de
-Status: Feedback
+Status: Analyzed
Bug Type: Strings related
Operating System: winXP SP3
PHP Version: 5.2.10
New Comment:
This is related to fixing bug #44929
I think skipping any punctuation instead of just '.' is probably the
right way to go here. Anything we do is going to be inexact though.
There is no spec for natural sorting to follow.
Previous Comments:
------------------------------------------------------------------------
[2009-07-21 18:42:09] jani@php.net
Please try using this snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2009-07-21 15:01:45] h dot beuttenmueller at gmx dot de
Description:
------------
If the following example-array was sorted by 'natsort' with PHP-Version
5.2.9-2 and 5.2.10 the resulting sort sequence is different:
Example-Array
[0] => 1_3
[1] => 0_0
[2] => 3_10
[3] => 3_4
[4] => 2_13
natsort - Result with PHP-Version 5.2.9-2
Array
[1] => 0_0
[0] => 1_3
[4] => 2_13
[3] => 3_4
[2] => 3_10
natsort - Result with PHP-Version 5.2.10
Array
[0] => 1_3
[4] => 2_13
[3] => 3_4
[2] => 3_10
[1] => 0_0
Reproduce code:
---------------
#once for PHP-Version 5.2.9-2 and once for 5.2.10
$a = array('1_3','0_0'.'3_10','3_4','2_13');
natsort($a);
print_r($a);
Expected result:
----------------
sort sequence should be the same between both (all:-) versions
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49003&edit=1