ID:               49003
 Updated by:       ras...@php.net
 Reported By:      h dot beuttenmueller at gmx dot de
-Status:           Analyzed
+Status:           Closed
 Bug Type:         Strings related
 Operating System: winXP SP3
 PHP Version:      5.2.10
 New Comment:

This bug has been fixed in SVN.

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/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2009-07-21 21:15:49] s...@php.net

Automatic comment from SVN on behalf of rasmus
Revision: http://svn.php.net/viewvc/?view=revision&revision=284559
Log: Fix bug #49003 by tweaking the fix to bug #44929 slightly.
A 0 followed by any punctuation is now significant instead
of just 0's in front of a period.

------------------------------------------------------------------------

[2009-07-21 20:30:18] ras...@php.net

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.

------------------------------------------------------------------------

[2009-07-21 18:42:09] j...@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

Reply via email to