What are the potential pitfalls of using arrays as function arguments in PHP?

Passing arrays as function arguments in PHP can lead to potential pitfalls such as modifying the original array unintentionally within the function, making the function less reusable, and increasing the complexity of the function. To avoid these issues, consider passing individual elements of the array as separate arguments or using associative arrays to clearly define the data being passed.

// Example of passing individual elements as arguments
function calculateTotal($item1, $item2, $item3) {
    return $item1 + $item2 + $item3;
}

$total = calculateTotal(10, 20, 30);
echo $total; // Output: 60