From:             pavlos at psychology dot gr
Operating system: Linux
PHP version:      4.4.2
PHP Bug Type:     Arrays related
Bug description:  array_multisort fails to trigger by val copy of data

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 bug report at http://bugs.php.net/?id=37451&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37451&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37451&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37451&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37451&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37451&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37451&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37451&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37451&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37451&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37451&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37451&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37451&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37451&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37451&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37451&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37451&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37451&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37451&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37451&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37451&r=mysqlcfg

Reply via email to