Consider a simple function:
function pass(&$arr)
{
// do something
}
If I call it like this…
$a = [1,2,3];
pass($a);
…this will work. However, if I do it like this,…
pass([1,2,3]);
…it will fail with the error Cannot pass parameter 1 by reference.
Why cant I get a reference to the temporary array in a function scope where the array is valid?