What are some common pitfalls when passing parameters to functions in PHP?

One common pitfall when passing parameters to functions in PHP is not specifying the correct number of parameters expected by the function. This can lead to errors or unexpected behavior. To avoid this issue, always make sure to pass the correct number of parameters when calling a function.

// Incorrect usage: not passing the correct number of parameters
function greet($name, $age) {
    echo "Hello, $name! You are $age years old.";
}

// Correct usage: passing the correct number of parameters
greet("Alice", 25);