What are the potential pitfalls of using array_multisort in PHP?

One potential pitfall of using array_multisort in PHP is that it modifies the original arrays passed as arguments. To avoid this, you can use array_multisort with a copy of the original arrays instead.

// Example of using array_multisort with a copy of the original arrays
$array1 = [3, 1, 2];
$array2 = ['c', 'a', 'b'];

$sorted_array1 = $array1;
$sorted_array2 = $array2;

array_multisort($sorted_array1, $sorted_array2);

// $array1 and $array2 remain unchanged