Edit report at http://bugs.php.net/bug.php?id=52733&edit=1
ID: 52733 Updated by: [email protected] Reported by: phpstars at gmail dot com Summary: -Status: Open +Status: Bogus Type: Bug Package: Output Control Operating System: Windows 7 PHP Version: 5.3.3 Block user comment: N New Comment: That's not a bug. You are confused about how array_multisort() works. Read the documentation again and look at the examples. The output you are getting is the expected output. The second array is put in the same order as the first. Previous Comments: ------------------------------------------------------------------------ [2010-08-30 02:50:54] phpstars at gmail dot com Description: ------------ I found this problem , use the latest version of XAMPP <?PHP $array1 = array (4,3,1,5,2); $array2 = array (7,9,6,10,8); array_multisort($array1,$array2); print_r ($array1); // Result : Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 ) echo '<BR>'; print_r ($array2); // Result : Array ( [0] => 6 [1] => 8 [2] => 9 [3] => 7 [4] => 10 ) // Note : Number 7 in the $array2 sorted after number 9 echo '<BR><HR><BR>'; $array1 = array (4,3,1,5,2); $array2 = array (7,9,6,10,8); array_multisort($array1); array_multisort($array2); print_r ($array1); // Result : Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 ) echo '<BR>'; print_r ($array2); // Result : Array ( [0] => 6 [1] => 7 [2] => 8 [3] => 9 [4] => 10 ) // Note : But when array_multisort($array2); separately was used, the output was correct ?> Test script: --------------- Expected result: ---------------- Actual result: -------------- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52733&edit=1
