Date: 08/16/00
- Next message: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #4081 Updated: Netscape 4.6 doesn`t displayphpinfo graphics."
- Previous message: Jason Burton: "[PHP-DEV] PHP 4.0 Bug #5451 Updated: Timeouts in running php.exe (IN event Log) preventing any PHP scripts to execu"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: alex <email protected>
Operating system: all
PHP version: 4.0.1pl2
PHP Bug Type: Misbehaving function
Bug description: array_multisort accepts only one SORT_REGULAR|SORT_NUMERIC|SORT_STRING flag
<?php
$dict = array(
"alpha", "bravo", "charlie", "delta",
"echo", "foxtrot", "golf", "hotel",
"yankee", "zulu"
);
srand((double)microtime() * 1000000);
$p = generate_str_array(100);
$q = range(0, 99);
shuffle($p);
shuffle($q);
array_multisort($p, SORT_DESC, SORT_STRING, $q, SORT_ASC, SORT_NUMERIC);
// !!!!! the second arrays is not sorted
print_array($p);
print_array($q);
function print_array(&$arr)
{
foreach ($arr as $i => $j)
print("$i: $j\n");
}
function generate_str_array($elements)
{
global $dict;
for ($i = 0; $i < $elements; $i++)
$arr[$i] = $dict[$i % sizeof($dict)];
return $arr;
}
?>
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Stanislav Malyshev: "Re: [PHP-DEV] PHP 4.0 Bug #4081 Updated: Netscape 4.6 doesn`t displayphpinfo graphics."
- Previous message: Jason Burton: "[PHP-DEV] PHP 4.0 Bug #5451 Updated: Timeouts in running php.exe (IN event Log) preventing any PHP scripts to execu"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

