#37451 [Fbk->Opn]: array_multisort fails to trigger by val copy of data
| From: | pavlos at psychology dot gr | Date: | Mon, 15 May 2006 22:58:14 +0000 |
| Subject: | #37451 [Fbk->Opn]: array_multisort fails to trigger by val copy of data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-97153@lists.php.net to get a copy of this message | ||
ID: 37451
User updated by: pavlos at psychology dot gr
Reported By: pavlos at psychology dot gr
-Status: Feedback
+Status: Open
Bug Type: Arrays related
Operating System: Linux
PHP Version: 4.4.2
New Comment:
Thank you for your lightning fast reply!
I have compiled the .tar.gz file. The problem is still here.
Previous Comments:
------------------------------------------------------------------------
[2006-05-15 22:14:39] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2006-05-15 22:01:30] pavlos at psychology dot gr
Description:
------------
This has been reported, filed as closed and in CVS, for more than a
year ago.
However, it is still alive in PHP 4.4.2.
Reproduce code:
---------------
$a = array(4, 3, 5, 2, 1);
$b = array(4, 3, 5, 2, 1);
$copy_a = $a;
array_multisort($copy_a);
print "\$a has changed as well: ";
print_r($a);
print "<BR>\$a should have been: ";
print_r($b);
Expected result:
----------------
$a has changed as well: Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4]
=> 5 )
$a should have been: Array ( [0] => 4 [1] => 3 [2] => 5 [3] => 2 [4] =>
1 )
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37451&edit=1