#19795 [NoF->Csd]: Problems with strnatcmp and strnatcasecmp

From: Date: Wed, 16 Apr 2003 21:11:22 +0000
Subject: #19795 [NoF->Csd]: Problems with strnatcmp and strnatcasecmp
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37777@lists.php.net to get a copy of this message
 ID:               19795
 Updated by:       moriyoshi@php.net
 Reported By:      doc at nitramlexa dot com
-Status:           No Feedback
+Status:           Closed
 Bug Type:         Strings related
 Operating System: FreeBSD 4.6
 PHP Version:      4.2.2
 New Comment:

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2003-01-27 16:11:34] kamikaze at yifan dot net

I have the same problem, with æøå. strtoupper() does, for example, not
uppercase those letters.

Also i 4.2.3

------------------------------------------------------------------------

[2002-11-10 18:21:28] sniper@php.net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.



------------------------------------------------------------------------

[2002-10-27 19:12:50] sniper@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip



------------------------------------------------------------------------

[2002-10-07 06:00:21] doc at nitramlexa dot com

I am quite sure I did that yes. I set locale for LC_ALL and strftime is
working as it should.

If I understand the documentation correctly, this function should work
as strcmp except for the fact that numbers are sorted in a natural
order. And strcmp does sort as I expect.

usort using strcmp:

array(11) {
  [0]=>
  string(1) "1"
  [1]=>
  int(1)
  [2]=>
  string(2) "12"
  [3]=>
  string(1) "2"
  [4]=>
  string(1) "a"
  [5]=>
  string(1) "z"
  [6]=>
  string(1) "€"
  [7]=>
  string(1) "‰"
  [8]=>
  string(1) "å"
  [9]=>
  string(1) "æ"
  [10]=>
  string(1) "ø"
}



using strnatcmp:

array(11) {
  [0]=>
  string(1) "€"
  [1]=>
  string(1) "‰"
  [2]=>
  string(1) "å"
  [3]=>
  string(1) "æ"
  [4]=>
  string(1) "ø"
  [5]=>
  string(1) "1"
  [6]=>
  int(1)
  [7]=>
  string(1) "2"
  [8]=>
  string(2) "12"
  [9]=>
  string(1) "a"
  [10]=>
  string(1) "z"
}

------------------------------------------------------------------------

[2002-10-07 03:58:36] derick@php.net

Did you set-up your locales correctly?

Derick

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/19795

-- 
Edit this bug report at http://bugs.php.net/?id=19795&edit=1



Thread (11 messages)

« previous php.bugs (#37777) next »