I have a stupid problem because I've got calls to this function all over my code base. Sometimes my code is run on PHP 5, 7 and who knows what else.
I need a way to resolve this deprecated code issue, hopefully without rewriting every call to the existing function.
It should be noted that the pass by reference is the main issue I'm struggling with right now.
Is it possible?
function getSetting(& $var, $default=0) {
if (isset($var)) {
return $var;
}
return $default;
}
Remember that sometimes a plain variable is passed in as the first parameter. Other times an array with non-existing index value is passed (and of course, sometimes the array index exists and has a value).
... the original reason I chose pass by reference so the function can look at the outer value.