Bug #12848: asort-SORT_NUMERIC inconsistent with non numeric values
| From: | kzi at gmx dot net | Date: | Sun, 19 Aug 2001 22:57:49 +0000 |
| Subject: | Bug #12848: asort-SORT_NUMERIC inconsistent with non numeric values | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-63783@lists.php.net to get a copy of this message | ||
From: kzi@gmx.net
Operating system: win98
PHP version: 4.0.6
PHP Bug Type: Arrays related
Bug description: asort-SORT_NUMERIC inconsistent with non numeric values
If asort() is used with the sort flag SORT_NUMERIC and the values ar non
numeric, the sort order of those values should remain unchanged in
principle. But in arrays with few of such non numeric items (app. < 10),
the first item is generally moved to the bottom, while in arrays with more
items, one element from somewhere in the middle is moved to the top.
example:
$q =
array(1=>'A',2=>'B',3=>'C',4=>'D',5=>'E');
asort($q,SORT_NUMERIC);
produces the value sequence B,C,D,E,A
--
Edit bug report at: http://bugs.php.net/?id=12848&edit=1