How can passing values directly to a function improve performance in PHP scripts?

Passing values directly to a function in PHP can improve performance by reducing the overhead of creating unnecessary variables. By passing values directly, we avoid the need to store values in variables before passing them to a function, which can save memory and processing time.

// Passing values directly to a function for improved performance
function calculateSum($num1, $num2) {
    return $num1 + $num2;
}

$result = calculateSum(5, 10);
echo $result; // Output: 15