#41443 [Opn->Bgs]: Wrong string sorting

From: Date: Sat, 19 May 2007 17:11:11 +0000
Subject: #41443 [Opn->Bgs]: Wrong string sorting
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-112858@lists.php.net to get a copy of this message
ID: 41443 Updated by: sniper@php.net Reported By: mr at orfalis dot com -Status: Open +Status: Bogus Bug Type: Strings related Operating System: Windows PHP Version: 5.2.2 New Comment: This is no bug, see manual for natsort(): http://www.php.net/natsort Previous Comments: ------------------------------------------------------------------------ [2007-05-19 08:18:17] mr at orfalis dot com Description: ------------ The string sorting output for the next program is wrong (just for 0 case, for any other number rather than 0, it works). Reproduce code: --------------- <?php $arr_test = array(); array_push($arr_test, '0'); array_push($arr_test, '0.0'); sort($arr_test); foreach($arr_test as $test){ print $test . "|"; } ?> Expected result: ---------------- 0|0.0 Actual result: -------------- 0.0|0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41443&edit=1

« previous php.bugs (#112858) next »