I have function that will process some array and change it for example sort, remove some chars from it etc.
My question here is if it is better to use:
1. Reference parameter like this:
public function doStuff(&$data) {
// $data processing here
}
and then my array will be changed without next assigment.
2. Calculate result and then return the result like this:
public function doStuff($data) {
// $data processing here
return $data;
}
So I need to assign result after processing.
Which is better (faster/recommended) solution to use? I have several arrays of 1000s records on which I want to apply my calculations.