Hi Rasmus,
The ext/standard/tests/array/natcasesort_variation3.phpt still fails.
The problematic code:
?php
$a=array(.0001, .0021, .09);
natcasesort($a);
var_dump($a);
?
Emits:
array(3) {
[0]=
float(0.0001)
[2]=
float(0.09)
[1]=
float(0.0021)
}
The float 0.09 is greater than 0.0021, but 9 is less than 21.
I'm not sure that should be fixed, the code or the test.
Probably natsort() shouldn't care about float numbers at all.
Thanks. Dmitry.
Rasmus Lerdorf wrote:
Hannes Magnusson wrote:
On Wed, Apr 8, 2009 at 20:10, Rasmus Lerdorf ras...@php.net wrote:
rasmus Wed Apr 8 18:10:46 2009 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/array bug44929.phpt
Modified files:
/php-src/ext/standard strnatcmp.c var_unserializer.c
Log:
Fixed bug #44929 - Better handling of leading zeros
This commit breaks float sorting, see
ext/standard/tests/array/natcasesort_variation3.phpt
Hrm.. I ran 'make test' several times. That test passed here. I'll
take a closer look.
-Rasmus
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php