Pretty simple question really, how do I pass undefined vars to functions without E_NOTICE errors?
When passing undefined variables to functions such as isset(), no e
Maybe something like this will work for you? It's a little bit hackish, but I think what you want is not quite possible without lazy evaluation of function arguments.
if (atLeastOneIsSet($myArray, 1, 3, 4, 6)) doSomething();
function atLeastOneIsSet(array $arr) {
$args = func_get_args();
for ($i = 1; $i < func_num_args(); ++$i)
if (isset($arr[$args[$i]])) return true;
return false;
}
Edit: oops, logic issues.