ID: 40903
Updated by: [EMAIL PROTECTED]
Reported By: jan at horde dot org
-Status: Open
+Status: Assigned
Bug Type: Arrays related
Operating System: Linux
PHP Version: 4CVS-2007-03-23 (CVS)
Assigned To: derick
Previous Comments:
------------------------------------------------------------------------
[2007-03-27 11:26:10] jan at horde dot org
Using worker/prefork here too. Derick, can you reproduce it? Is there
anything else I could try to track this down?
------------------------------------------------------------------------
[2007-03-26 23:33:42] [EMAIL PROTECTED]
"worker/mpm" should be read as "worker/prefork".
------------------------------------------------------------------------
[2007-03-26 23:31:57] [EMAIL PROTECTED]
Tested with Apache 2 worker/mpm and latest CVS.
Cannot replicate.
------------------------------------------------------------------------
[2007-03-23 10:55:36] jan at horde dot org
Description:
------------
This is a really weird edge case. See the unit test pasted below. If I
run this test on the command line, it works fine. But if run the same
test through the web server, the sorting simply doesn't happen. Apache
is version 2.2.0. Passing the array through mysort() by reference is
important, if I sort the array directly, everything is working fine.
Reproduce code:
---------------
--TEST--
uasort
--FILE--
<?php
$array = array(
array('sort' => 'Horde (horde)'),
array('sort' => 'E-Mail Mobil (mimp)'),
array('sort' => 'Webmail Dynamisch (dimp)'));
function mysort(&$array)
{
uasort($array, create_function('$a, $b', '$cmp =
strcoll(strtolower($a["sort"]), strtolower($b["sort"]));
var_dump($a["sort"], $b["sort"], $cmp); return $cmp;'));
}
mysort($array);
var_dump($array);
?>
--EXPECT--
string(19) "E-Mail Mobil (mimp)"
string(13) "Horde (horde)"
int(-1)
string(24) "Webmail Dynamisch (dimp)"
string(19) "E-Mail Mobil (mimp)"
int(1)
string(13) "Horde (horde)"
string(19) "E-Mail Mobil (mimp)"
int(1)
string(24) "Webmail Dynamisch (dimp)"
string(13) "Horde (horde)"
int(1)
array(3) {
[1]=>
array(1) {
["sort"]=>
string(19) "E-Mail Mobil (mimp)"
}
[0]=>
array(1) {
["sort"]=>
string(13) "Horde (horde)"
}
[2]=>
array(1) {
["sort"]=>
string(24) "Webmail Dynamisch (dimp)"
}
}
Actual result:
--------------
Result if run through apache:
string(19) "E-Mail Mobil (mimp)"
string(13) "Horde (horde)"
int(-1)
string(24) "Webmail Dynamisch (dimp)"
string(19) "E-Mail Mobil (mimp)"
int(1)
string(13) "Horde (horde)"
string(19) "E-Mail Mobil (mimp)"
int(1)
string(24) "Webmail Dynamisch (dimp)"
string(13) "Horde (horde)"
int(1)
array(3) {
[0]=>
array(1) {
["sort"]=>
string(13) "Horde (horde)"
}
[1]=>
array(1) {
["sort"]=>
string(19) "E-Mail Mobil (mimp)"
}
[2]=>
array(1) {
["sort"]=>
string(24) "Webmail Dynamisch (dimp)"
}
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40903&edit=1