From: [EMAIL PROTECTED]
Operating system: winxp
PHP version: 4.2.1
PHP Bug Type: Performance problem
Bug description: fails to ignore case
<?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 bug report at http://bugs.php.net/?id=17316&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17316&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17316&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17316&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17316&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17316&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17316&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17316&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17316&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17316&r=globals