PHP array return array vs passing as reference
Just never return an argument by reference. It is nearly as bad as using global. And even a memory management is not an excuse. In case your array is big, create a function that does the calculations, and then apply it to each element inside of an explicit loop.