[cq] Do not pass by reference where avoidable
One of our nastier code legacies is the prevalence of pass-by-reference - many places in code look something like this
function doIt(&$params) {
// don't alter $params
}
doIt($params);
In order to understand what is happening wit $params it is necessary to dig into the function to see if $params is altered in the process.
On an ongoing basis we need to identify places where a variable is passed-by-reference unnecessarily and remove the &
Note that these were added originally for 2 reasons
- retrofitting php4 compatibility
- the incorrect belief it was more efficient on memory