why not keepKeep things simple?:
<?php
error_reporting(E_ALL); // makingMaking sure all notices are on
function idxVal(&$var, $default = null) {
return empty($var) ? $var = $default : $var;
}
echo idxVal($arr['test']); // returnsReturns null without any notice
echo idxVal($arr['hey ho'], 'yo'); // returnsReturns yo and assigns it to the array index,. nice
Nice
?>