#11372 [Com]: array_multisort does not maintain key association
| From: | old-lady69 at hotmail dot com | Date: | Tue, 20 Jul 2004 15:06:17 +0000 |
| Subject: | #11372 [Com]: array_multisort does not maintain key association | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-63100@lists.php.net to get a copy of this message | ||
ID: 11372
Comment by: old-lady69 at hotmail dot com
Reported By: rkenny at mke dot catalystwms dot com
Status: Bogus
Bug Type: Arrays related
Operating System: Windows NT 4.0 SP6a
PHP Version: 4.0.5
New Comment:
<a href=http://1000ugly-cellophane.da.ru>lady
old</a>
Previous Comments:
------------------------------------------------------------------------
[2002-02-26 21:40:57] yohgaki@php.net
The version of PHP that this bug was reported in is too old. Please
try to reproduce this bug in the latest version of PHP (available
from http://www.php.net/downloads.php
If you are still able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
I think this is fixed. If not, please reopen.
------------------------------------------------------------------------
[2001-06-08 22:09:48] rkenny at mke dot catalystwms dot com
Here's a quick script to reproduce the problem:
<?
$x = array ("filename" => array (0 => "joe.doc", 1 =>
"ralph.doc",
2 => "maria.xls")
, "size" => array (0 => "jbig", 1 => "rsmall", 2 =>
"mmed")
, "modified" => array (0 => "54", 1 => "32", 2 =>
"99")
);
# array_multisort ($x["modified"]);
asort ($x["modified"]);
reset ($x["modified"]);
echo "<p><b>Values in x</b><br>";
while (list ($key, $val) = each ($x)) {
echo "$key => $val<br>";
}
echo "<p><b>Values in filename</b><br>";
while (list ($key, $val) = each ($x["filename"])) {
echo "$key => $val<br>";
}
echo "<p><b>Values in size</b><br>";
while (list ($key, $val) = each ($x["size"])) {
echo "$key => $val<br>";
}
echo "<p><b>Values in modified</b><br>";
while (list ($key, $val) = each ($x["modified"])) {
echo "$key => $val<br>";
}
?>
Uncomment the "array_multisort" line and comment the "asort" line to
witness the bug first hand.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=11372&edit=1