PHP 4.0 Bug #5019 Updated: ksort is broken
| From: | Bug Database | Date: | Wed, 14 Jun 2000 00:38:11 +0000 |
| Subject: | PHP 4.0 Bug #5019 Updated: ksort is broken | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21279@lists.php.net to get a copy of this message | ||
ID: 5019
Updated by: andrei
Reported By: massaro@nextis.com.br
Status: Closed
Bug Type: Misbehaving function
Assigned To:
Comments:
This is due to PHP's attempt at "smart" comparison when comparing numbers
and strings. String "12" will be interpreted as number 12, but "a" is
interpreted
as 0. It's possible to specify the sort order by providing an optional second
argument to sorting functions: SORT_REGULAR, SORT_NUMERIC, and
SORT_STRING. Try ksort($ls, SORT_STRING).
Full Bug description available at: http://bugs.php.net/version4/?id=5019