Re: cvs: php-src(PHP_5_3) /ext/standard strnatcmp.c var_unserializer.c /ext/standard/tests/array bug44929.phpt

From: Date: Tue, 21 Apr 2009 11:33:35 +0000
Subject: Re: cvs: php-src(PHP_5_3) /ext/standard strnatcmp.c var_unserializer.c /ext/standard/tests/array bug44929.phpt
References: 1 2 3  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-57122@lists.php.net to get a copy of this message
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 <rasmus@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


« previous php.cvs (#57122) next »