Bug #17316 Updated: fails to ignore case
| From: | sniper@php.net | Date: | Mon, 17 Jun 2002 19:11:35 +0000 |
| Subject: | Bug #17316 Updated: fails to ignore case | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-10922@lists.php.net to get a copy of this message | ||
ID: 17316
Updated by: sniper@php.net
Reported By: swoo@gvlabs.com
Status: Open
-Bug Type: Performance problem
+Bug Type: Arrays related
Operating System: any
PHP Version: 4.2.1
Previous Comments:
------------------------------------------------------------------------
[2002-06-17 07:46:22] hholzgra@php.net
reproduced on linux using CLI
------------------------------------------------------------------------
[2002-05-20 15:01:36] swoo@gvlabs.com
<?php
class test
{
var $items = array();
function stuff($listx){
for($i=0;$i<count($listx);$i++){
array_push($this->items,$listx[$i]);
}
}
function testsort1(){
echo "<hr>sort<hr>";
sort($this->items);
for($i=0;$i<count($this->items);$i++){
echo $this->items[$i]."<br>";
}
}
function testsort2(){
echo "<hr>natsort<hr>";
natsort($this->items);
for($i=0;$i<count($this->items);$i++){
echo $this->items[$i]."<br>";
}
}
function testsort3(){
echo "<hr>natcasesort<hr>";
natcasesort($this->items);
for($i=0;$i<count($this->items);$i++){
echo $this->items[$i]."<br>";
}
}
}
$t =
array("apple","car","zebra","Foobar","Blank");
$K = new test;
$K->stuff($t);
$K->testsort1();
$J = new test;
$J->stuff($t);
$J->testsort2();
$M = new test;
$M->stuff($t);
$M->testsort3();
echo "<hr>";
natcasesort($t);
foreach($t as $t2){
echo $t2."<br>";
}
?>
used the php binary for win32
natcasesort works outside of the class object as demonstated by the
last example.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17316&edit=1